'use client'; import { useFormStatus } from 'react-dom'; import { KeyboardEventHandler, forwardRef } from 'react'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; import { cn } from '@/lib/utils'; import { FormErrors } from './form-errors'; interface FormTextareaProps { id: string; label?: string; placeholder?: string; required?: boolean; disabled?: boolean; errors?: Record; className?: string; onBlur?: () => void; onClick?: () => void; onKeyDown?: KeyboardEventHandler | undefined; defaultValue?: string; } export const FormTextarea = forwardRef( ( { id, label, placeholder, required, disabled, errors, className, onBlur, onClick, onKeyDown, defaultValue, }, ref ) => { const { pending } = useFormStatus(); return (
{label ? ( ) : null}