import { FormControl, InputLabel, MenuItem, Select, type SelectProps, type SelectChangeEvent, styled, } from '@mui/material'; import { SELECT_ITEM_ID } from 'utils/testIds'; import KeyboardArrowDownOutlined from '@mui/icons-material/KeyboardArrowDownOutlined'; import type { SxProps } from '@mui/system'; import type { Theme } from '@mui/material/styles'; import { visuallyHidden } from '@mui/utils'; export interface ISelectOption { key: string; title?: string; label?: string; disabled?: boolean; sx?: SxProps; } export interface IGeneralSelectProps extends Omit { name?: string; value?: T; label?: string; options: ISelectOption[]; onChange: (key: T) => void; disabled?: boolean; fullWidth?: boolean; classes?: any; defaultValue?: string; visuallyHideLabel?: boolean; variant?: 'outlined' | 'filled' | 'standard'; } const StyledFormControl = styled(FormControl)({ maxWidth: '100%', }); function GeneralSelect({ variant = 'outlined', name, value, label = '', options, onChange, id, disabled = false, className, classes, fullWidth, visuallyHideLabel, labelId, ...rest }: IGeneralSelectProps) { const onSelectChange = (event: SelectChangeEvent) => { event.preventDefault(); onChange(String(event.target.value) as T); }; return ( {label ? ( {label} ) : null} ); } export default GeneralSelect;