import { jsx as _jsx } from "react/jsx-runtime";
import { AgentDocumentList, } from "./AgentDocumentList";
import { AgentEditOperationsPanel } from "./EditOperationsPanel";
import { SpawnedAgentsPanel } from "./SpawnedAgentsPanel";
import { TodoListPanel } from "./TodoListPanel";
import { SimpleTabs } from "../../../ui/SimpleTabs";
export function AgentTerminalContextPanels({ hideContext, simpleMode, isMobile, contextChrome, agent, activeProfile, documentListRef, hasTodoContent, hasSpawnedAgents, hasHistoryContent, messages, agentMetadata, operations, activeTab, setActiveTab, }) {
    if (hideContext || simpleMode) {
        return null;
    }
    if (isMobile) {
        return (_jsx("div", { className: "border-border-default bg-neutral-grey-5 border-t", "data-testid": "agent-context-panel-tabs", children: _jsx(SimpleTabs, { tabs: [
                    {
                        id: "context",
                        label: "Context",
                        content: contextChrome,
                    },
                    ...(agent?.id && activeProfile
                        ? [
                            {
                                id: "documents",
                                label: "Documents",
                                content: (_jsx(AgentDocumentList, { ref: documentListRef, agentId: agent.id, maxFileSizeMB: activeProfile.maxDocumentSizeMB ?? 10, enabled: activeProfile.enableDocumentUpload ?? false, profileId: activeProfile.id }, `${agent.id}-${agent.updatedDate || ""}-${activeProfile.id}`)),
                            },
                        ]
                        : []),
                    ...(hasTodoContent
                        ? [
                            {
                                id: "todos",
                                label: "Todos",
                                content: (_jsx(TodoListPanel, { messages: messages, agentMetadata: agentMetadata })),
                            },
                        ]
                        : []),
                    ...(hasSpawnedAgents
                        ? [
                            {
                                id: "agents",
                                label: "Spawned",
                                content: (_jsx(SpawnedAgentsPanel, { agentMetadata: agentMetadata })),
                            },
                        ]
                        : []),
                    ...(agent?.id && hasHistoryContent
                        ? [
                            {
                                id: "history",
                                label: "History",
                                content: (_jsx(AgentEditOperationsPanel, { operations: operations })),
                            },
                        ]
                        : []),
                ], activeTab: Math.max(0, Math.min(activeTab, [
                    true,
                    agent?.id && activeProfile,
                    hasTodoContent,
                    hasSpawnedAgents,
                    agent?.id && hasHistoryContent,
                ].filter(Boolean).length - 1)), setActiveTab: setActiveTab, className: "justify-start px-4" }) }));
    }
    // Desktop: the tray panels are surfaced as popover icons overlaying the
    // prompt textarea (see AgentPromptTrayPopovers, wired in AgentTerminalView).
    return null;
}
//# sourceMappingURL=AgentTerminalContextPanels.js.map