import { useState, useRef, useEffect } from 'react'; export default function PromptBar({ onSubmit, onStop, isGenerating, generationProgress, status }) { const [input, setInput] = useState(''); const textareaRef = useRef(null); useEffect(() => { if (textareaRef.current) { textareaRef.current.style.height = 'auto'; textareaRef.current.style.height = Math.min(textareaRef.current.scrollHeight, 120) + 'px'; } }, [input]); const handleSubmit = () => { if (!input.trim() || isGenerating) return; onSubmit(input.trim()); setInput(''); }; const handleKeyDown = (e) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); handleSubmit(); } }; return (