import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { useSyncExternalStore } from "react";
import { Plus, SquarePen } from "lucide-react";
import { SimpleIconButton } from "../editor/ui/SimpleIconButton";
import { useEditContext } from "../editor/client/editContext";
import { cn } from "../lib/utils";
import { subscribeAgentsNav, getAgentsNavSnapshot } from "./agentsNavStore";
/**
 * AgentsTitlebar - Titlebar content for the Agents workspace.
 * Shows the workspace identity (icon + title + subtitle) on the left,
 * and the +New Agent + show/hide editor toggle on the right.
 */
export function AgentsTitlebar() {
    const editContext = useEditContext();
    const nav = useSyncExternalStore(subscribeAgentsNav, getAgentsNavSnapshot, getAgentsNavSnapshot);
    if (!editContext?.workspace)
        return null;
    const { showAgentsWorkspaceEditor, setShowAgentsWorkspaceEditor } = editContext;
    const showSubtitle = !editContext.isMobile;
    return (_jsxs("div", { className: cn("flex w-full flex-row items-center gap-3 pl-2", editContext.isMobile && "border-b px-1.5 py-1"), children: [_jsxs("div", { className: "flex min-w-0 flex-1 flex-col items-start justify-center leading-tight", "data-testid": "agents-titlebar-identity", children: [_jsx("span", { className: "text-neutral-grey-100 truncate text-sm leading-tight font-medium", children: "AI Agents" }), showSubtitle && (_jsx("span", { className: "text-neutral-grey-50 truncate text-[11px] leading-tight", children: "Build, run and orchestrate your AI workforce" }))] }), _jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [nav.onCreateAgent && (_jsxs("button", { type: "button", onClick: () => nav.onCreateAgent?.(), className: "bg-highlight-100 hover:bg-highlight-100/90 inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-medium text-white shadow-sm transition-colors", "data-testid": "agents-titlebar-new-agent-button", children: [_jsx(Plus, { className: "size-4", strokeWidth: 2.25 }), "New Agent"] })), !editContext.isMobile && (_jsxs(_Fragment, { children: [_jsx("div", { className: "bg-border-default mx-1 h-6 w-px", "aria-hidden": "true" }), _jsx(SimpleIconButton, { icon: _jsx(SquarePen, { className: "h-5 w-5", strokeWidth: 1 }), label: showAgentsWorkspaceEditor ? "Hide Editor" : "Show Editor", size: "large", "data-testid": "editor-panel-toggle", selected: showAgentsWorkspaceEditor, onClick: () => setShowAgentsWorkspaceEditor(!showAgentsWorkspaceEditor) })] }))] })] }));
}
//# sourceMappingURL=AgentsTitlebar.js.map