import { FieldValues, RegisterOptions, useFormContext } from 'react-hook-form'; import { ChangeEventHandler } from 'react'; // Styled import { StyledSelect } from './styled'; export interface ISelectOptions { value: string; label: string; } interface ISelect { options: ISelectOptions[]; optionsConfigForm?: RegisterOptions | undefined; value?: string; onChange?: ChangeEventHandler | undefined; id?: string; ariaLabel: string; disable?: boolean; } const Select = ({ options, id, optionsConfigForm, value, onChange, ariaLabel, disable = false, }: ISelect) => { const { register } = useFormContext() ?? {}; if (!options) return; return ( {options.map((option) => ( ))} ); }; export default Select;