import { cn } from "@/app/utils/functions"; import { CloseEyeIcon } from "@/app/utils/svgs/closeEyeIcon"; import { EyeIcon } from "@/app/utils/svgs/eyeIcon"; import React from "react"; const Input = ({ label, name, type, placeholder, value, onChange, required, disabled, readOnly, hasError = false, className, parentClassName, errorMessage, autoComplete, darkTheme = false, htmlFor, id, maxLength, }: { label?: string; name: string; type?: string; placeholder?: string; value?: string; onChange?: (e: React.ChangeEvent) => void; required?: boolean; disabled?: boolean; readOnly?: boolean; className?: string; parentClassName?: string; hasError?: boolean; errorMessage?: string; autoComplete?: string; darkTheme?: boolean; htmlFor?: string; id?: string; maxLength?: number; }) => { const [showPassword, setShowPassword] = React.useState(false); const defaultTheme = "text-[var(--color-secondary-800)] ring-[var(--color-secondary-200)] bg-white disabled:bg-[var(--color-secondary-200)] disabled:text-[var(--color-secondary-400)] disabled:placeholder:text-[var(--color-secondary-400)] disabled:ring-[var(--color-secondary-300)]"; return (
{ type === 'password' && ( ) }
{errorMessage && (
{errorMessage}
)}
); }; export default Input;