"use client";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { cn } from "@stigmer/theme";
import { PeopleWithAccess } from "./PeopleWithAccess.js";
/**
 * Self-contained sharing panel that displays who has access to a
 * resource and allows granting/revoking access.
 *
 * A thin header-and-close wrapper around {@link PeopleWithAccess} — the same
 * "people with access" body the unified Manage access dialog renders — so the
 * two surfaces stay byte-for-byte consistent. Suitable for embedding in a
 * popover or sidebar; for the full visibility + people experience use the
 * Manage access dialog instead.
 *
 * All visual properties flow through `--stgm-*` design tokens.
 *
 * @example
 * ```tsx
 * <SharePanel
 *   resource={{ kind: "session", id: sessionId, resourceKind: ApiResourceKind.session }}
 *   resourceKindString="session"
 *   resourceKind={ApiResourceKind.session}
 *   orgId={orgId}
 *   onClose={() => setOpen(false)}
 * />
 * ```
 */
export function SharePanel({ resource, resourceKindString, resourceKind, orgId, onClose, className, }) {
    return (_jsxs("div", { className: cn("flex flex-col gap-4 p-4", className), role: "region", "aria-label": "Resource access management", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("h3", { className: "text-sm font-semibold text-foreground", children: "Share access" }), onClose && (_jsx("button", { type: "button", onClick: onClose, "aria-label": "Close share panel", className: cn("rounded-md p-1 text-muted-foreground", "hover:text-foreground hover:bg-accent-hover"), children: _jsx(CloseIcon, {}) }))] }), _jsx(PeopleWithAccess, { resource: resource, resourceKindString: resourceKindString, resourceKind: resourceKind, orgId: orgId })] }));
}
function CloseIcon() {
    return (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "M4 4l8 8M12 4l-8 8" }) }));
}
//# sourceMappingURL=SharePanel.js.map