import { forwardRef, useId } from "react"; import type { TextareaHTMLAttributes } from "react"; import { cn } from "@/lib/utils/cn"; export interface TextareaProps extends TextareaHTMLAttributes { label?: string; error?: string; hint?: string; } export const Textarea = forwardRef( ({ className, label, error, hint, id, required, rows = 4, ...props }, ref) => { const generatedId = useId(); const textareaId = id ?? generatedId; const hintId = hint ? `${textareaId}-hint` : undefined; const errorId = error ? `${textareaId}-error` : undefined; return (
{label && ( )}