import { Conversation, ConversationContent, } from "@code/ui/components/ai-elements/conversation"; import { LoaderCircle, MessagesSquare } from "lucide-react"; import { ChatMessage } from "@/components/chat/chat-message"; import { ChatThinkingResponse } from "@/components/chat/chat-thinking-response"; import type { ChatAgentState } from "@/lib/chat/types"; interface ConversationPanelProps { readonly agent: ChatAgentState; readonly title: string; readonly emptyHint: string; } export const ConversationPanel = ({ agent, emptyHint, title, }: ConversationPanelProps) => { if (agent.status === "connecting" && !agent.historyReady) { return (
Loading conversation…
); } if (agent.historyReady && agent.messages.length === 0) { return (

{title}

{emptyHint}

); } return ( {agent.messages.map((message) => ( ))} {agent.status === "submitted" ? : null} ); };