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;