/*
 * @Author: your name
 * @Date: 2021-11-10 16:32:55
 * @LastEditTime: 2022-01-18 17:32:26
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /KC-MiddlePlatform/src/components/kc-select/index.tsx
 */
import React from 'react';
import { Select } from 'antd';
import { SelectProps, SelectValue } from 'antd/lib/select';
import './style.less';

interface KCSelectProps {}

class KCSelect<
  ValueType extends SelectValue = SelectValue,
> extends React.Component<SelectProps<ValueType>> {
  static defaultProps = {
    showSearch: false,
    allowClear: true,
    optionFilterProp: 'children',
    filterOption: (input: string, option: any) =>
      option!.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
  };

  public render() {
    const { children, ...restProps } = this.props;
    return (
      <div className="KCSelect">
        <Select {...restProps}>{children}</Select>
      </div>
    );
  }
}

export default KCSelect;
