"use client";
import { jsx, jsxs } from "react/jsx-runtime";
const RESULT_CLASSES = {
  allowed: { text: "text-emerald-600 dark:text-emerald-400", bg: "bg-emerald-50 dark:bg-emerald-950/30" },
  blocked: { text: "text-red-600 dark:text-red-400", bg: "bg-red-50 dark:bg-red-950/30" },
  error: { text: "text-amber-600 dark:text-amber-400", bg: "bg-amber-50 dark:bg-amber-950/30" }
};
function EventFlow({ entries }) {
  if (entries.length === 0) {
    return /* @__PURE__ */ jsx("p", { className: "text-xs italic text-muted-foreground", children: "No event flow data" });
  }
  const recent = entries.slice(-15).reverse();
  return /* @__PURE__ */ jsx("div", { children: recent.map((entry, idx) => {
    const classes = RESULT_CLASSES[entry.result] ?? RESULT_CLASSES.allowed;
    return /* @__PURE__ */ jsxs(
      "div",
      {
        className: `mb-0.5 flex items-center justify-between rounded p-1 px-2 text-xs ${classes.bg}`,
        children: [
          /* @__PURE__ */ jsxs("div", { children: [
            /* @__PURE__ */ jsx("span", { className: "font-medium", children: entry.eventName }),
            /* @__PURE__ */ jsx("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: entry.widgetId })
          ] }),
          /* @__PURE__ */ jsx("span", { className: `text-[11px] font-semibold ${classes.text}`, children: entry.result })
        ]
      },
      idx
    );
  }) });
}
export {
  EventFlow
};
//# sourceMappingURL=EventFlow.js.map
