import { ProFormSelect, ProFormSelectProps } from '@ant-design/pro-components';

export type { ProFormSelectProps as BaseFormSelectProps };

const BaseFormSelect = (props: ProFormSelectProps) => {
  return (
    <ProFormSelect
      {...props}
      placeholder={
        props?.placeholder ??
        `请选择${typeof props?.label === 'string' ? props?.label : ''}`
      }
      fieldProps={{
        ...props?.fieldProps,
        showSearch:
          typeof props?.fieldProps?.showSearch === 'boolean'
            ? props?.fieldProps?.showSearch
            : true,
      }}
    />
  );
};

export default BaseFormSelect;
