"use client";
import { jsx, jsxs } from "react/jsx-runtime";
const TYPE_COLORS = {
  enricher: "bg-blue-500",
  interceptor: "bg-amber-500",
  "component-override": "bg-violet-500",
  "injection-widget": "bg-emerald-500",
  "injection-data-widget": "bg-cyan-500"
};
function ExtensionPointList({ extensions }) {
  if (extensions.length === 0) {
    return /* @__PURE__ */ jsx("p", { className: "text-xs italic text-muted-foreground", children: "No extensions registered" });
  }
  const grouped = /* @__PURE__ */ new Map();
  for (const ext of extensions) {
    const key = ext.type;
    const group = grouped.get(key) ?? [];
    group.push(ext);
    grouped.set(key, group);
  }
  return /* @__PURE__ */ jsx("div", { children: Array.from(grouped.entries()).map(([type, items]) => /* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
    /* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide", children: [
      /* @__PURE__ */ jsx("span", { className: `inline-block size-2 rounded-full ${TYPE_COLORS[type] ?? "bg-muted-foreground"}` }),
      type,
      " (",
      items.length,
      ")"
    ] }),
    /* @__PURE__ */ jsx("div", { className: "pl-3.5", children: items.map((ext, idx) => /* @__PURE__ */ jsxs(
      "div",
      {
        className: "flex items-center justify-between border-b border-border/50 py-1 text-xs",
        children: [
          /* @__PURE__ */ jsxs("div", { children: [
            /* @__PURE__ */ jsx("span", { className: "font-medium", children: ext.id }),
            /* @__PURE__ */ jsxs("span", { className: "ml-1.5 text-muted-foreground", children: [
              "[",
              ext.moduleId,
              "]"
            ] })
          ] }),
          /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
            /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground", children: ext.target }),
            ext.priority !== 0 && /* @__PURE__ */ jsxs("span", { className: "rounded bg-muted px-1.5 py-px text-[10px] font-semibold", children: [
              "P",
              ext.priority
            ] })
          ] })
        ]
      },
      `${ext.id}-${idx}`
    )) })
  ] }, type)) });
}
export {
  ExtensionPointList
};
//# sourceMappingURL=ExtensionPointList.js.map
