From c1de138ca8d50525e7eee5f138119dc8d6fff075 Mon Sep 17 00:00:00 2001 From: kleap-admin Date: Thu, 15 Jan 2026 13:04:19 +0000 Subject: [PATCH] Update components/password.tsx --- components/password.tsx | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 components/password.tsx diff --git a/components/password.tsx b/components/password.tsx new file mode 100644 index 0000000..cc2270a --- /dev/null +++ b/components/password.tsx @@ -0,0 +1,47 @@ +import { EyeIcon, EyeOffIcon } from "lucide-react"; +import React from "react"; +import { useState } from "react"; + +import { Control, Path } from "react-hook-form"; +import { FieldValues } from "react-hook-form"; + +export interface CommonReactHookFormProps { + name: Path; + control: Control; +} + +interface PasswordProps + extends React.InputHTMLAttributes< + HTMLInputElement & CommonReactHookFormProps + > {} + +function Password(props: PasswordProps) { + const [show, setShow] = useState(false); + return ( +
+ +
+ {!show && ( + setShow(true)} + className="text-gray-400 cursor-pointer h-4" + /> + )} + {show && ( + setShow(false)} + className="text-gray-400 cursor-pointer h-4" + /> + )} +
+
+ ); +} + +export default Password;