"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _select = _interopRequireDefault(require("antd/lib/select"));
var _extends2 = _interopRequireDefault(require("@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["default"], (0, _extends2["default"])({
    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));
};
var _default = search;
exports["default"] = _default;