import { useState, useRef, useEffect } from 'react' import { Send } from 'lucide-react' const InputBar = ({ onSend, onReset, disabled }) => { const [input, setInput] = useState('') const textareaRef = useRef(null) // Auto-resize textarea useEffect(() => { if (textareaRef.current) { textareaRef.current.style.height = 'auto' textareaRef.current.style.height = Math.min(textareaRef.current.scrollHeight, 120) + 'px' } }, [input]) const handleSend = async () => { if (input.trim() && !disabled) { await onSend(input) setInput('') if (textareaRef.current) { textareaRef.current.style.height = 'auto' } } } const handleKeyDown = (e) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault() handleSend() } } return (
{/* New button */} {/* Input box */}