From e26d821f738525477472e631d170d9ed218c1603 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 25 Feb 2022 19:17:09 +0100
Subject: chore: combine input/textarea/select in a single component

---
 src/components/Form/Select/Select.tsx | 56 -----------------------------------
 1 file changed, 56 deletions(-)
 delete mode 100644 src/components/Form/Select/Select.tsx

(limited to 'src/components/Form/Select/Select.tsx')

diff --git a/src/components/Form/Select/Select.tsx b/src/components/Form/Select/Select.tsx
deleted file mode 100644
index feab991..0000000
--- a/src/components/Form/Select/Select.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import { ChangeEvent, ReactElement, SetStateAction } from 'react';
-import styles from './Select.module.scss';
-
-type SelectOptions = {
-  id: string;
-  name: string;
-  value: string;
-};
-
-const Select = ({
-  options,
-  id,
-  name,
-  value,
-  setValue,
-  required = false,
-  label,
-}: {
-  options: SelectOptions[];
-  id: string;
-  name: string;
-  value: string;
-  setValue: (value: SetStateAction<string>) => void;
-  required?: boolean;
-  label?: ReactElement;
-}) => {
-  const getOptions = () => {
-    return options.map((option) => (
-      <option key={option.id} value={option.value}>
-        {option.name}
-      </option>
-    ));
-  };
-
-  const handleChange = (event: ChangeEvent<HTMLSelectElement>) => {
-    setValue(event.target.value);
-  };
-
-  return (
-    <>
-      {label}
-      <select
-        name={name}
-        id={id}
-        value={value}
-        onChange={handleChange}
-        required={required}
-        className={styles.wrapper}
-      >
-        {getOptions()}
-      </select>
-    </>
-  );
-};
-
-export default Select;
-- 
cgit v1.2.3

