import { useId, type ComponentProps } from "react"; export interface TextInputProps extends Omit< ComponentProps<"input">, "onChange" > { label: string; onChange?: (value: string) => void; error?: string; description?: string; } export function TextInput({ label, id, onChange, error, description, className = "", "aria-describedby": describedBy, ...props }: TextInputProps) { const generatedId = useId(); const inputId = id ?? generatedId; const hint = error ?? description; const hintId = `${inputId}-hint`; return (
{hint}
)}