'use client'; import { useEffect, useRef, TextareaHTMLAttributes } from 'react'; export default function AutoTextarea(props: TextareaHTMLAttributes) { const textareaRef = useRef(null); const adjustHeight = () => { const textarea = textareaRef.current; if (textarea) { textarea.style.height = 'auto'; textarea.style.height = `${textarea.scrollHeight}px`; } }; useEffect(() => { adjustHeight(); }, [props.value]); return (