import React__default from 'react';

var RenderTarget = function RenderTarget(_ref) {
  var multiselect = _ref.multiselect,
    value = _ref.value,
    renderTarget = _ref.renderTarget,
    valueToItemMap = _ref.valueToItemMap,
    inputWrapperRef = _ref.inputWrapperRef;
  var content;
  if (multiselect) {
    var selectedItems = value.map(function (itemValue) {
      return valueToItemMap.get(itemValue);
    }).filter(function (item) {
      return Boolean(item);
    });
    content = renderTarget(selectedItems);
  } else {
    var selectedItem = valueToItemMap.get(value);
    content = selectedItem ? renderTarget(selectedItem) : null;
  }
  return /*#__PURE__*/React__default.createElement("div", {
    ref: inputWrapperRef
  }, content);
};

export { RenderTarget };
