"use client"; import React, { useState } from "react"; import { Controller, Control } from "react-hook-form"; // ui import { Eye, EyeOff } from "lucide-react"; import { Input } from "@plane/ui"; // icons // helpers import { cn } from "@/helpers/common.helper"; type Props = { control: Control; type: "text" | "password"; name: string; label: string; description?: string | JSX.Element; placeholder: string; error: boolean; required: boolean; }; export type TControllerInputFormField = { key: string; type: "text" | "password"; label: string; description?: string | JSX.Element; placeholder: string; error: boolean; required: boolean; }; export const ControllerInput: React.FC = (props) => { const { name, control, type, label, description, placeholder, error, required } = props; // states const [showPassword, setShowPassword] = useState(false); return (

{label}

( )} /> {type === "password" && (showPassword ? ( ) : ( ))}
{description &&

{description}

}
); };