import _Select from "antd/es/select";
import _extends from "@babel/runtime/helpers/extends";
var search = function search(props) {
  console.log(props, '--------searchProps');
  var placeholder = props.placeholder,
    onChange = props.onChange,
    onSearch = props.onSearch,
    options = props.options,
    filterSort = props.filterSort;
  return /*#__PURE__*/React.createElement(_Select, _extends({
    showSearch: true,
    placeholder: placeholder,
    optionFilterProp: "children",
    onChange: onChange,
    onSearch: onSearch,
    filterOption: function filterOption(input, option) {
      var _option$label;
      return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase().includes(input.toLowerCase());
    },
    filterSort: function filterSort(optionA, optionB) {
      var _optionA$label, _optionB$label;
      return ((_optionA$label = optionA === null || optionA === void 0 ? void 0 : optionA.label) !== null && _optionA$label !== void 0 ? _optionA$label : '').toLowerCase().localeCompare(((_optionB$label = optionB === null || optionB === void 0 ? void 0 : optionB.label) !== null && _optionB$label !== void 0 ? _optionB$label : '').toLowerCase());
    },
    options: options
  }, props))
  // <Select
  //   showSearch
  //   style={{
  //     width: 200,
  //   }}
  //   placeholder="Search to Select"
  //   optionFilterProp="children"
  //   filterOption={(input, option) => (option?.label ?? '').includes(input)}
  //   filterSort={(optionA, optionB) =>{
  //     console.log((optionA?.label ?? '').toLowerCase().localeCompare((optionB?.label ?? '').toLowerCase()),'------')
  //     return   (optionA?.label ?? '').toLowerCase().localeCompare((optionB?.label ?? '').toLowerCase())
  //   }

  //   }
  //   options={[
  //     {
  //       value: '1',
  //       label: 'Not Identified',
  //     },
  //     {
  //       value: '2',
  //       label: 'Closed',
  //     },
  //     {
  //       value: '3',
  //       label: 'Communicated',
  //     },
  //     {
  //       value: '4',
  //       label: 'Identified',
  //     },
  //     {
  //       value: '5',
  //       label: 'Resolved',
  //     },
  //     {
  //       value: '6',
  //       label: 'Cancelled',
  //     },
  //   ]}
  // />
  ;
};

export default search;