import React, { useState, useRef, useEffect } from 'react'; import { Message, AgentType } from '../types'; import { Send, User, Bot, Loader2 } from 'lucide-react'; interface ChatInterfaceProps { messages: Message[]; onSendMessage: (content: string) => void; isProcessing: boolean; } const ChatInterface: React.FC = ({ messages, onSendMessage, isProcessing }) => { const [input, setInput] = useState(''); const messagesEndRef = useRef(null); const scrollToBottom = () => { messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' }); }; useEffect(() => { scrollToBottom(); }, [messages]); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (!input.trim() || isProcessing) return; onSendMessage(input); setInput(''); }; const renderMessageIcon = (sender: string) => { if (sender === 'User') return ; return ; }; return (
{/* Header */}

Orchestration Chat

Interacting with Orchestrator Agent (Memory Active)

{/* Messages */}
{messages.map((msg) => (
{renderMessageIcon(msg.sender)}
{msg.sender} {msg.timestamp.toLocaleTimeString()}
{msg.content}
))} {isProcessing && (
Orchestrator is delegating...
)}
{/* Input */}
setInput(e.target.value)} placeholder="Describe your task (e.g., 'Plan a new health app' or 'Ask Jules to fix the bug')..." className="w-full bg-gray-800 border-gray-700 text-white rounded-lg pl-4 pr-12 py-3 focus:outline-none focus:ring-2 focus:ring-blue-600 focus:border-transparent placeholder-gray-500" />
); }; export default ChatInterface;