From 8e907e75ea1efa555ba66332b73d2f54283331c6 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sun, 14 Mar 2021 05:43:24 +0300
Subject: feat: add Input component

---
 src/components/Input.tsx | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 src/components/Input.tsx

(limited to 'src/components/Input.tsx')

diff --git a/src/components/Input.tsx b/src/components/Input.tsx
new file mode 100644
index 0000000..69b97a2
--- /dev/null
+++ b/src/components/Input.tsx
@@ -0,0 +1,21 @@
+import React from 'react';
+
+export interface Props extends React.InputHTMLAttributes<HTMLInputElement> {
+  label?: string;
+}
+
+const Input: React.FC<Props> = ({ label, ...props }) => {
+  return (
+    <div className="m-2 mb-4 flex flex-col">
+      <label htmlFor={props?.name} className="mb-1 text-gray-700">{label}</label>
+      <input
+        id={props?.name}
+        placeholder={label}
+        className="p-2 border-2 border-black focus:outline-none"
+        {...props}
+      />
+    </div>
+  );
+};
+
+export default Input;
-- 
cgit v1.2.3

