import { useEffect, useRef, useState } from 'react' import DomainButtons from './DomainButtons' import MessageBubble from './MessageBubble' export default function ChatPanel({ conversation, categories, loading, onSend, }) { const [draft, setDraft] = useState('') const messagesEndRef = useRef(null) const textareaRef = useRef(null) const messages = conversation?.messages || [] useEffect(() => { messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' }) }, [messages.length, loading]) function handleSubmit(event) { event.preventDefault() const trimmed = draft.trim() if (!trimmed || loading) return onSend(trimmed) setDraft('') } function handleKeyDown(event) { if (event.key === 'Enter' && !event.shiftKey) { event.preventDefault() handleSubmit(event) } } function handlePick(question) { setDraft(question) textareaRef.current?.focus() } return (

{conversation ? conversation.title : 'Aegis'}

Local instruction-tuned model · LOS + Guidewire + Duck Creek + general insurance · retrieval augmented

{messages.length === 0 && (
Æ

Ask Aegis something

Pick a domain below or type your own question. Experimental model — do not rely on it for real loan, underwriting, claims, or financial decisions.

)} {messages.map((message, index) => ( ))} {loading && (
)}