import React, { useState } from 'react'; import { Upload, MessageSquare } from 'lucide-react'; import { AgentCard } from '../components/AgentCard'; import { ChatMessage } from '../components/ChatMessage'; import { processFile } from '../utils/fileProcessing'; interface Message { content: string; sender: 'user' | 'agent'; timestamp: Date; } export default function GradioInterface() { const [messages, setMessages] = useState([]); const [inputText, setInputText] = useState(''); const [agents] = useState([ { config: { name: 'MGA Analyst', goal: 'Analyze insurance queries and delegate tasks', backstory: 'Expert executive-director agent' }, status: 'idle' as const }, { config: { name: 'Underwriter', goal: 'Evaluate risks and recommend policies', backstory: 'Expert risk assessor' }, status: 'idle' as const } ]); const handleFileUpload = async (event: React.ChangeEvent) => { const file = event.target.files?.[0]; if (file) { const processedFile = await processFile(file); setMessages(prev => [...prev, { content: `File uploaded: ${file.name}`, sender: 'user', timestamp: new Date() }]); } }; const handleSendMessage = () => { if (inputText.trim()) { setMessages(prev => [...prev, { content: inputText, sender: 'user', timestamp: new Date() }]); setInputText(''); } }; return (
{messages.map((msg, idx) => ( ))}
setInputText(e.target.value)} className="flex-1 px-4 py-2 border rounded-lg" placeholder="Type your message..." onKeyPress={(e) => e.key === 'Enter' && handleSendMessage()} />

Agent Status

{agents.map((agent, idx) => ( ))}
); }