'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Modal } from '../../components/ui/Modal.js';
import { getSectionTypesForScope } from './section-types.js';
import { sectionIconFor } from './section-icons.js';
/**
 * Predefined section gallery. Only types that have a working renderer +
 * inspector are listed (the registry is the source of truth), so every
 * card here actually inserts a usable section.
 *
 * (Saved-section / template insertion is a separate flow — deferred until
 * the saved-section storage model is reconciled with the flat section
 * model; see the page-editor changeset.)
 */
export function AddSectionModal({ open, onClose, onAdd, scope = 'page' }) {
    const types = getSectionTypesForScope(scope);
    return (_jsxs(Modal, { open: open, onClose: onClose, title: "Add a section", children: [_jsx("p", { className: "text-muted-foreground mb-4 text-sm", children: "Choose a section type. It will be added to the bottom and selected for editing." }), _jsx("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: types.map((type) => {
                    const Icon = sectionIconFor(type.id);
                    return (_jsxs("button", { type: "button", onClick: () => onAdd(type.id), className: "border-border hover:border-primary hover:bg-accent/50 focus-visible:ring-ring flex items-start gap-3 rounded-lg border p-3 text-left transition-colors focus-visible:ring-2 focus-visible:outline-none", children: [_jsx("span", { className: "bg-muted text-foreground flex h-9 w-9 shrink-0 items-center justify-center rounded-md", children: _jsx(Icon, { className: "h-5 w-5", "aria-hidden": true }) }), _jsxs("span", { className: "min-w-0", children: [_jsx("span", { className: "text-foreground block text-sm font-medium", children: type.name }), _jsx("span", { className: "text-muted-foreground mt-0.5 block text-xs leading-snug", children: type.description })] })] }, type.id));
                }) })] }));
}
//# sourceMappingURL=AddSectionModal.js.map