From 21eb67ef5e59d36b996392f60b5045f152a64604 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 1 Apr 2022 22:57:12 +0200
Subject: chore: add a labelled select field component

---
 src/components/molecules/forms/labelled-select.tsx | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 src/components/molecules/forms/labelled-select.tsx

(limited to 'src/components/molecules/forms/labelled-select.tsx')

diff --git a/src/components/molecules/forms/labelled-select.tsx b/src/components/molecules/forms/labelled-select.tsx
new file mode 100644
index 0000000..442e91a
--- /dev/null
+++ b/src/components/molecules/forms/labelled-select.tsx
@@ -0,0 +1,25 @@
+import Label from '@components/atoms/forms/label';
+import Select, { type SelectProps } from '@components/atoms/forms/select';
+import { FC } from 'react';
+
+type LabelledSelectProps = SelectProps & {
+  label: string;
+};
+
+const LabelledSelect: FC<LabelledSelectProps> = ({
+  id,
+  label,
+  required,
+  ...props
+}) => {
+  return (
+    <>
+      <Label htmlFor={id} required={required}>
+        {label}
+      </Label>
+      <Select id={id} required={required} {...props} />
+    </>
+  );
+};
+
+export default LabelledSelect;
-- 
cgit v1.2.3

