"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" },
  modified: { text: "text-status-warning-icon", bg: "bg-status-warning-bg" }
};
function InterceptorActivity({ entries }) {
  if (entries.length === 0) {
    return /* @__PURE__ */ jsx("p", { className: "text-xs italic text-muted-foreground", children: "No interceptor activity" });
  }
  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-1 rounded p-1.5 px-2 text-xs ${classes.bg}`, children: [
      /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
        /* @__PURE__ */ jsx("span", { className: "font-medium", children: entry.interceptorId }),
        /* @__PURE__ */ jsx("span", { className: `text-overline font-semibold uppercase ${classes.text}`, children: entry.result })
      ] }),
      /* @__PURE__ */ jsxs("div", { className: "mt-0.5 text-overline text-muted-foreground", children: [
        entry.method,
        " ",
        entry.route,
        " | ",
        entry.durationMs,
        "ms",
        entry.statusCode ? ` | ${entry.statusCode}` : ""
      ] }),
      entry.message && /* @__PURE__ */ jsx("div", { className: "mt-px text-overline text-muted-foreground/70", children: entry.message })
    ] }, idx);
  }) });
}
export {
  InterceptorActivity
};
//# sourceMappingURL=InterceptorActivity.js.map
