import * as React from 'react'; import { Resizable } from 're-resizable'; import { cn } from '@/lib/utils'; import { Textarea } from '@/components/ui/textarea'; type ResizableTextareaProps = React.TextareaHTMLAttributes & { initialHeight?: number; minHeight?: number; maxHeight?: number; }; export const ResizableTextarea = React.forwardRef< HTMLTextAreaElement, ResizableTextareaProps >( ( { className, initialHeight = 120, minHeight = 80, maxHeight = 800, ...textareaProps }, ref ) => { const [height, setHeight] = React.useState(initialHeight); const isDisabled = Boolean(textareaProps.disabled); return ( { setHeight(current => Math.max(minHeight, Math.min(maxHeight, current + delta.height))); }} handleComponent={{ bottom: (
), }} handleStyles={{ bottom: { bottom: 0 } }} className="mb-3" >