'use client'; import { VoiceIcon } from '@/assets/chatacter'; import { cn } from '@/lib'; import Image from 'next/image'; import { useRef, useEffect, useState } from 'react'; export default function Input() { const textareaRef = useRef(null); const [value, setValue] = useState(''); const className = 'h-11 inline-flex items-center justify-center w-15 rounded-full hover:cursor-pointer shrink-0'; useEffect(() => { const textarea = textareaRef.current; if (textarea) { textarea.style.height = 'auto'; const newHeight = Math.min(textarea.scrollHeight, 100); // 最大高度 100px textarea.style.height = `${newHeight}px`; // 隐藏滚动条 textarea.style.scrollbarWidth = 'none'; // Firefox // @ts-ignore textarea.style.msOverflowStyle = 'none'; // IE/Edge } }, [value]); return (