From a69e81076a45830e162c1fd7c21525a899f8368a Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Fri, 31 Jan 2025 06:23:54 +0530 Subject: [PATCH] (feat:components) add label props --- frontend/src/components/Input.tsx | 40 +++++++++++++++--------- frontend/src/components/ToggleSwitch.tsx | 8 ++--- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/Input.tsx b/frontend/src/components/Input.tsx index 17e60190..f7b1765e 100644 --- a/frontend/src/components/Input.tsx +++ b/frontend/src/components/Input.tsx @@ -7,6 +7,7 @@ const Input = ({ value, isAutoFocused = false, placeholder, + label, maxLength, className, colorVariant = 'silver', @@ -26,21 +27,30 @@ const Input = ({ thick: 'border-2', }; return ( - - {children} - +
+ + {children} + + {label && ( +
+ + {label} + +
+ )} +
); }; diff --git a/frontend/src/components/ToggleSwitch.tsx b/frontend/src/components/ToggleSwitch.tsx index 02745799..061d2563 100644 --- a/frontend/src/components/ToggleSwitch.tsx +++ b/frontend/src/components/ToggleSwitch.tsx @@ -23,9 +23,12 @@ const ToggleSwitch: React.FC = ({ }) => { return ( ); };