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/FormElements/Label/Label.tsx | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 src/components/FormElements/Label/Label.tsx

(limited to 'src/components/FormElements/Label/Label.tsx')

diff --git a/src/components/FormElements/Label/Label.tsx b/src/components/FormElements/Label/Label.tsx
new file mode 100644
index 0000000..baedff0
--- /dev/null
+++ b/src/components/FormElements/Label/Label.tsx
@@ -0,0 +1,24 @@
+import styles from './Label.module.scss';
+
+type LabelKind = 'regular' | 'settings';
+
+const Label = ({
+  body,
+  htmlFor,
+  required = false,
+  kind = 'regular',
+}: {
+  body: string;
+  htmlFor: string;
+  required?: boolean;
+  kind?: LabelKind;
+}) => {
+  return (
+    <label htmlFor={htmlFor} className={styles[kind]}>
+      {body}
+      {required && <span className={styles.required}> *</span>}
+    </label>
+  );
+};
+
+export default Label;
-- 
cgit v1.2.3

