"use client"; import React from "react"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { cn } from "@/lib/utils"; import { Eye, EyeOff } from "lucide-react"; interface FormFieldProps { label: string; name: string; type?: "text" | "email" | "password" | "tel" | "number"; placeholder?: string; error?: string; disabled?: boolean; required?: boolean; className?: string; inputProps?: React.ComponentProps; showPasswordToggle?: boolean; onPasswordToggle?: () => void; showPassword?: boolean; } export const FormField: React.FC = ({ label, name, type = "text", placeholder, error, disabled = false, required = false, className, inputProps, showPasswordToggle = false, onPasswordToggle, showPassword = false, }) => { const inputType = showPasswordToggle && type === "password" ? (showPassword ? "text" : "password") : type; return (
{showPasswordToggle && ( )}
{error && ( )}
); };