mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-22 20:01:59 +00:00
Update code, create booking services
This commit is contained in:
@@ -19,6 +19,7 @@ interface ISelect {
|
||||
onChange?: ChangeEventHandler<HTMLSelectElement> | undefined;
|
||||
id?: string;
|
||||
ariaLabel: string;
|
||||
disable?: boolean;
|
||||
}
|
||||
|
||||
const Select = ({
|
||||
@@ -28,6 +29,7 @@ const Select = ({
|
||||
value,
|
||||
onChange,
|
||||
ariaLabel,
|
||||
disable = false,
|
||||
}: ISelect) => {
|
||||
const { register } = useFormContext() ?? {};
|
||||
|
||||
@@ -38,6 +40,7 @@ const Select = ({
|
||||
aria-label={ariaLabel}
|
||||
id={id}
|
||||
value={value}
|
||||
disabled={disable}
|
||||
{...(register
|
||||
? { ...register(id!, optionsConfigForm) }
|
||||
: { onChange: onChange })}
|
||||
|
||||
Reference in New Issue
Block a user