"use client"; import { useId } from "react"; import { cn } from "@/shared/utils/cn"; export default function Input({ label, type = "text", placeholder, value, onChange, error, hint, icon, disabled = false, required = false, className, inputClassName, id: externalId, ...props }) { 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}

)}
); }