import { useState, useRef, useEffect } from 'react' import { ArrowUp } from 'lucide-react' interface ChatInputProps { onSend: (message: string) => void disabled?: boolean } export function ChatInput({ onSend, disabled }: ChatInputProps) { const [value, setValue] = useState('') const textareaRef = useRef(null) // Auto-resize textarea useEffect(() => { const el = textareaRef.current if (!el) return el.style.height = 'auto' el.style.height = Math.min(el.scrollHeight, 160) + 'px' }, [value]) const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault() handleSend() } } const handleSend = () => { const trimmed = value.trim() if (!trimmed || disabled) return onSend(trimmed) setValue('') } return (