'use strict';

var SelectInput_utils = require('../SelectInput.utils.js');
var SelectInputOption = require('../Option/SelectInputOption.js');
var SelectInputGroupItemView = require('./GroupItemView/SelectInputGroupItemView.js');
var jsxRuntime = require('react/jsx-runtime');

function SelectInputItemView({
  item,
  renderValue,
  needle
}) {
  switch (item.type) {
    case 'option':
      {
        if (item.value != null && (needle == null || SelectInput_utils.selectInputOptionItemIncludesNeedle(item, needle))) {
          return /*#__PURE__*/jsxRuntime.jsx(SelectInputOption.SelectInputOption, {
            value: item.value,
            disabled: item.disabled,
            children: renderValue(item.value, false)
          });
        }
        break;
      }
    case 'group':
      {
        return /*#__PURE__*/jsxRuntime.jsx(SelectInputGroupItemView.SelectInputGroupItemView, {
          item: item,
          renderValue: renderValue,
          needle: needle
        });
      }
    case 'separator':
      {
        if (needle == null) {
          return /*#__PURE__*/jsxRuntime.jsx("hr", {
            className: "np-select-input-separator-item"
          });
        }
        break;
      }
  }
  return null;
}

exports.SelectInputItemView = SelectInputItemView;
//# sourceMappingURL=SelectInputItemView.js.map
