diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-02-25 19:17:09 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-02-25 19:17:09 +0100 |
| commit | e26d821f738525477472e631d170d9ed218c1603 (patch) | |
| tree | 70ec0c29d003d462de6926f1faa09354e3ff6d90 /src/components/Form/TextArea/TextArea.tsx | |
| parent | cb4764f8670f67627c407591c89b8d3637c190a7 (diff) | |
chore: combine input/textarea/select in a single component
Diffstat (limited to 'src/components/Form/TextArea/TextArea.tsx')
| -rw-r--r-- | src/components/Form/TextArea/TextArea.tsx | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/components/Form/TextArea/TextArea.tsx b/src/components/Form/TextArea/TextArea.tsx deleted file mode 100644 index b8894ab..0000000 --- a/src/components/Form/TextArea/TextArea.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { ChangeEvent, ReactElement, SetStateAction } from 'react'; -import styles from '../Form.module.scss'; - -const TextArea = ({ - id, - name, - value, - setValue, - label, -}: { - id: string; - name: string; - value: string; - setValue: (value: SetStateAction<string>) => void; - label?: ReactElement; -}) => { - const updateValue = (e: ChangeEvent<HTMLTextAreaElement>) => { - setValue(e.target.value); - }; - - return ( - <> - {label} - <textarea - id={id} - name={name} - value={value} - onChange={updateValue} - className={`${styles.field} ${styles.textarea}`} - /> - </> - ); -}; - -export default TextArea; |
