"use client"; import { useId } from "react"; import { cn } from "@/shared/utils/cn"; interface InputProps extends Omit, "size"> { label?: React.ReactNode; error?: React.ReactNode; hint?: React.ReactNode; icon?: string; inputClassName?: string; } export default function Input({ label, type = "text", placeholder, value, onChange, error, hint, icon, disabled = false, required = false, className, inputClassName, id: externalId, ...props }: InputProps) { const generatedId = useId(); const inputId = externalId || generatedId; const errorId = error ? `${inputId}-error` : undefined; const hintId = hint && !error ? `${inputId}-hint` : undefined; const describedBy = [errorId, hintId].filter(Boolean).join(" ") || undefined; return (
{label && ( )}
{icon && (
)}
{error && ( )} {hint && !error && (

{hint}

)}
); }