blob: 4731c42fd30849b5a1c9668a0e55b7a89f6708ac [file] [log] [blame]
giocc5ce582025-06-25 07:45:21 +04001import React from "react";
2import { ChatBubble } from "./ChatBubble";
3import { useAgents } from "@/lib/state";
4
5// Approximate height of a collapsed bubble + gap for cascading
6const BUBBLE_CASCADE_OFFSET = 70; // e.g., 50px height + 10px padding + 10px gap
7const INITIAL_BOTTOM_OFFSET = 20;
8const INITIAL_RIGHT_OFFSET = 20;
9
10export function ChatManager(): React.ReactNode {
11 // TODO(gio): reconsider
12 return null;
13 const agents = useAgents();
14 if (agents.length === 0) {
15 return null;
16 }
17 return (
18 <>
19 {agents.map((agent, index) => {
20 const initialPosition = {
21 bottom: INITIAL_BOTTOM_OFFSET + index * BUBBLE_CASCADE_OFFSET,
22 right: INITIAL_RIGHT_OFFSET,
23 top: undefined, // Ensure top/left are not set if bottom/right are
24 left: undefined,
25 };
26 return (
27 <ChatBubble
28 key={agent.name}
gio74c6f752025-07-05 04:10:58 +000029 agentName={agent.agentName}
giocc5ce582025-06-25 07:45:21 +040030 agentUrl={agent.address}
31 initialPosition={initialPosition}
32 />
33 );
34 })}
35 </>
36 );
37}