"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { cn } from "../../../lib/utils";
function BDDTableOfContents({
  tests,
  activeTestId,
  onSelectTest
}) {
  const getPriorityDot = (priority) => {
    switch (priority) {
      case "high":
        return "bg-red-500";
      case "medium":
        return "bg-yellow-500";
      case "low":
        return "bg-green-500";
      default:
        return "bg-slate-400";
    }
  };
  return /* @__PURE__ */ jsxs("div", { className: "space-y-2", "data-cy": "bdd-toc", children: [
    /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-muted-foreground uppercase tracking-wide px-2", children: "Test Cases" }),
    /* @__PURE__ */ jsx("nav", { className: "space-y-1", children: tests.map((test, index) => /* @__PURE__ */ jsxs(
      "button",
      {
        onClick: () => onSelectTest(test.id),
        className: cn(
          "w-full text-left px-2 py-1.5 rounded-md text-sm transition-colors",
          "hover:bg-accent hover:text-accent-foreground",
          "flex items-center gap-2",
          activeTestId === test.id ? "bg-violet-100 text-violet-900 dark:bg-violet-900/30 dark:text-violet-100" : "text-muted-foreground"
        ),
        "data-cy": `bdd-toc-item-${test.id}`,
        children: [
          /* @__PURE__ */ jsx(
            "span",
            {
              className: cn(
                "w-2 h-2 rounded-full shrink-0",
                getPriorityDot(test.metadata.priority)
              )
            }
          ),
          /* @__PURE__ */ jsx("span", { className: "font-mono text-xs text-muted-foreground shrink-0", children: String(index + 1).padStart(2, "0") }),
          /* @__PURE__ */ jsx("span", { className: "truncate", children: test.title })
        ]
      },
      test.id
    )) })
  ] });
}
export {
  BDDTableOfContents
};
