From 0b3146f7278929c4d1b33dd8f94f34e351e5e5a9 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 8 Apr 2022 22:36:24 +0200 Subject: chore: add a Settings modal component --- src/components/atoms/forms/select.tsx | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/components/atoms/forms/select.tsx') diff --git a/src/components/atoms/forms/select.tsx b/src/components/atoms/forms/select.tsx index a42dbda..25e86e0 100644 --- a/src/components/atoms/forms/select.tsx +++ b/src/components/atoms/forms/select.tsx @@ -1,17 +1,30 @@ -import { ChangeEvent, FC, SetStateAction } from 'react'; +import { ChangeEvent, SetStateAction, VFC } from 'react'; import styles from './forms.module.scss'; export type SelectOptions = { + /** + * The option id. + */ id: string; + /** + * The option name. + */ name: string; + /** + * The option value. + */ value: string; }; export type SelectProps = { /** - * Set additional classes. + * One or more ids that refers to the select field name. + */ + 'aria-labelledby'?: string; + /** + * Add classnames to the select field. */ - classes?: string; + className?: string; /** * Field state. Either enabled (false) or disabled (true). */ @@ -47,8 +60,8 @@ export type SelectProps = { * * Render a HTML select element. */ -const Select: FC = ({ - classes = '', +const Select: VFC = ({ + className = '', options, setValue, ...props @@ -74,7 +87,7 @@ const Select: FC = ({ return (