"use client";
import { jsx } from "react/jsx-runtime";
import { useInjectionDataWidgets } from "./useInjectionDataWidgets.js";
import { StatusBadgeRenderer } from "./StatusBadgeRenderer.js";
function isStatusBadgeWidget(widget) {
  const mod = widget.module ?? widget;
  return mod && typeof mod === "object" && "kind" in mod && mod.kind === "status-badge" && "badge" in mod;
}
function StatusBadgeInjectionSpot({ spotId, context }) {
  const { widgets, isLoading } = useInjectionDataWidgets(spotId);
  if (isLoading || widgets.length === 0) return null;
  const badgeWidgets = widgets.filter(isStatusBadgeWidget);
  if (badgeWidgets.length === 0) return null;
  const badgeContext = {
    organizationId: context.organizationId ?? "",
    tenantId: context.tenantId ?? "",
    userId: context.userId ?? ""
  };
  return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1", children: badgeWidgets.map((widget) => {
    const mod = widget.module ?? widget;
    return /* @__PURE__ */ jsx(
      StatusBadgeRenderer,
      {
        widget: mod,
        context: badgeContext
      },
      mod.metadata?.id ?? widget.key
    );
  }) });
}
export {
  StatusBadgeInjectionSpot
};
//# sourceMappingURL=StatusBadgeInjectionSpot.js.map
