diff --git a/web/client/src/components/chat/ChatInput.tsx b/web/client/src/components/chat/ChatInput.tsx new file mode 100644 index 0000000..0c64acf --- /dev/null +++ b/web/client/src/components/chat/ChatInput.tsx @@ -0,0 +1,41 @@ +import { useState, useRef } from 'react'; +import { Send } from 'lucide-react'; +import { Button } from '@/components/ui/button'; + +export function ChatInput({ onSend }: { onSend: (content: string) => void }) { + const [input, setInput] = useState(''); + const ref = useRef(null); + + const handleSend = () => { + if (!input.trim()) return; + onSend(input.trim()); + setInput(''); + ref.current?.focus(); + }; + + const handleKeyDown = (e: React.KeyboardEvent) => { + if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault(); + handleSend(); + } + }; + + return ( +
+
+