"use client";
import { jsx, jsxs } from "react/jsx-runtime";
const RESULT_CLASSES = {
  allowed: { text: "text-status-success-icon", bg: "bg-status-success-bg" },
  blocked: { text: "text-status-error-icon", bg: "bg-status-error-bg" },
  error: { text: "text-status-warning-icon", bg: "bg-status-warning-bg" }
};
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-overline text-muted-foreground", children: entry.widgetId })
          ] }),
          /* @__PURE__ */ jsx("span", { className: `text-overline font-semibold ${classes.text}`, children: entry.result })
        ]
      },
      idx
    );
  }) });
}
export {
  EventFlow
};
//# sourceMappingURL=EventFlow.js.map
