From f0c03a9b8e15387c4defd0a0e3e0298324406fae Mon Sep 17 00:00:00 2001
From: flu0r1ne <flu0r1ne@flu0r1ne.net>
Date: Mon, 28 Aug 2023 21:33:44 -0500
Subject: Add wg2nd

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

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

diff --git a/components/Input/index.tsx b/components/Input/index.tsx
new file mode 100644
index 0000000..69f64fa
--- /dev/null
+++ b/components/Input/index.tsx
@@ -0,0 +1,22 @@
+import React, { TextareaHTMLAttributes, ForwardRefRenderFunction } from 'react';
+import { getSystemStyle, SystemProps } from '../utils/systemProps';
+import inputElStyle from '../utils/inputElementStyle';
+
+interface InputProps
+  extends React.InputHTMLAttributes<HTMLInputElement>,
+  SystemProps
+{ }
+
+const Input: ForwardRefRenderFunction<HTMLInputElement, InputProps> =
+  ({ style, ...props }, ref) => {
+    style = {
+      ...inputElStyle,
+      ...style,
+    };
+
+    const systemStyle = getSystemStyle(props, style);
+
+    return <input ref={ref} style={systemStyle} {...props} />;
+  };
+
+export default React.forwardRef(Input);
-- 
cgit v1.2.3

