import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { cn } from "../lib/utils";
import { CloseButton } from "../components/ui/close-button";
export const ACTIVE_AGENT_PREFIX = "active-agent:";
/**
 * Sidebar content for the agents workspace (mobile only).
 * Shows currently active agents plus an "All Agents" link to return to the
 * overview when no agent is open.
 */
export function AgentsSidebar({ activeAgents, activeSidebarKey, onNavClick, onCloseAgent, }) {
    const isAllAgentsActive = !activeSidebarKey || !activeSidebarKey.startsWith(ACTIVE_AGENT_PREFIX);
    return (_jsxs("div", { className: "flex min-h-0 flex-1 flex-col overflow-auto p-4", children: [_jsx("div", { className: "text-neutral-grey-50 mb-3 px-2 text-sm font-semibold tracking-wide", children: "Agents" }), _jsx("button", { type: "button", className: cn("flex w-full cursor-pointer items-center gap-3 rounded-lg py-2.5 pr-3 pl-5 text-left text-sm transition-all", "text-neutral-grey-100 hover:bg-neutral-grey-5 hover:text-neutral-grey-100", "focus-visible:ring-feedback-blue focus-visible:ring-2 focus-visible:outline-none", isAllAgentsActive && "bg-highlight-10 text-highlight-100"), onClick: () => onNavClick(""), children: _jsx("span", { className: "min-w-0 flex-1 truncate font-medium", children: "All Agents" }) }), activeAgents.length > 0 && (_jsxs("div", { className: "border-border-default mt-6 border-t pt-4", children: [_jsx("div", { className: "text-neutral-grey-50 mb-3 px-2 text-sm font-semibold tracking-wide", children: "Active Agents" }), _jsx("div", { className: "flex flex-col gap-1", children: activeAgents.map((a) => {
                            const key = `${ACTIVE_AGENT_PREFIX}${a.id}`;
                            const isActive = activeSidebarKey === key;
                            return (_jsxs("div", { className: cn("group flex items-center gap-2 rounded-lg py-2.5 pr-2 pl-5 text-left text-sm transition-all", "text-neutral-grey-100 hover:bg-neutral-grey-5 hover:text-neutral-grey-100", isActive && "bg-highlight-10 text-highlight-100"), children: [_jsx("button", { type: "button", className: "min-w-0 flex-1 truncate text-left font-medium", onClick: () => onNavClick(key), title: a.name || "Untitled", children: a.name || "Untitled" }), _jsx(CloseButton, { onClick: (e) => onCloseAgent(a.id, e), label: `Close ${a.name || "agent"}` })] }, a.id));
                        }) })] }))] }));
}
//# sourceMappingURL=AgentsSidebar.js.map