/**
 * @desc 选择框
 * @author denghuan
 */
import React, { useMemo } from 'react';
import { Select as AntSelect } from 'antd';
const { SECRET_COMBOBOX_MODE_DO_NOT_USE, Option, OptGroup } = AntSelect;
const Select = (props) => {
    const { placeholder = '请选择', allowClear = true, dictData, options, ...others } = props;
    const newOptions = useMemo(() => {
        return dictData
            ? dictData.map(item => {
                return { value: item.id, label: item.name };
            })
            : options;
    }, [dictData, options]);
    return (React.createElement(AntSelect, { placeholder: placeholder, allowClear: allowClear, options: newOptions, ...others }));
};
Select.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;
Select.Option = Option;
Select.OptGroup = OptGroup;
export default Select;
