import { jsx as _jsx } from "react/jsx-runtime";
import { GenericToolbar } from "./GenericToolbar";
import { ReviewCommands, EditControls, InsertControls, ViewportControls, UtilityControls, CompareControls, UndoRedoControls, AgentCommandsToolbar, } from "./toolbar-sections";
export function createEditToolbar(editContext) {
    if (!editContext)
        return null;
    const hasLayout = editContext.item?.hasLayout;
    const isReviewsWorkspace = editContext.workspaceId === "reviews" || editContext.workspaceId === "comments";
    // For items without layout (simple content editor)
    if (!hasLayout) {
        const left = [
            {
                key: "undo-redo-controls",
                component: _jsx(UndoRedoControls, {}),
            },
        ];
        const center = [
            {
                key: "compare",
                component: _jsx(CompareControls, {}),
            },
        ];
        return (_jsx(GenericToolbar, { left: left, center: center, right: [
                {
                    key: "agent-commands",
                    component: _jsx(AgentCommandsToolbar, {}),
                },
                {
                    key: "utility-controls",
                    component: _jsx(UtilityControls, {}),
                },
            ] }));
    }
    // For pages with layout
    const left = [];
    const right = [];
    const center = [];
    // Add review commands if in reviews view
    // Standard edit controls
    left.push({
        key: "edit-controls",
        component: _jsx(EditControls, {}),
    });
    // Undo/Redo controls
    left.push({
        key: "undo-redo-controls",
        component: _jsx(UndoRedoControls, {}),
    });
    if (isReviewsWorkspace) {
        left.push({
            key: "review-commands",
            component: _jsx(ReviewCommands, {}),
        });
    }
    // Insert controls
    left.push({
        key: "insert-controls",
        component: _jsx(InsertControls, {}),
    });
    // Viewport controls (desktop/mobile/form)
    center.push({
        key: "viewport-controls",
        component: _jsx(ViewportControls, {}),
    });
    // Agent commands toolbar (configurable agent shortcuts)
    right.push({
        key: "agent-commands",
        component: _jsx(AgentCommandsToolbar, {}),
    });
    // Utility controls (compare, fullscreen, sidebar)
    right.push({
        key: "utility-controls",
        component: _jsx(UtilityControls, {}),
    });
    return _jsx(GenericToolbar, { left: left, right: right, center: center });
}
//# sourceMappingURL=ToolbarFactory.js.map