"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import * as React from "react";
import { match } from "ts-pattern";
import { useT } from "@open-mercato/shared/lib/i18n/context";
const STEP_ORDER = ["provider", "configure", "confirm"];
const WizardNav = (props) => {
  const { step, onNavigate } = props;
  const t = useT();
  const stepIndex = STEP_ORDER.indexOf(step);
  const stepLabels = {
    provider: t("shipping_carriers.create.step.provider", "Select carrier"),
    configure: t("shipping_carriers.create.step.configure", "Configure shipment"),
    confirm: t("shipping_carriers.create.step.confirm", "Select service & confirm")
  };
  return /* @__PURE__ */ jsx("nav", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: STEP_ORDER.map((stepId, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
    index > 0 ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u203A" }) : null,
    /* @__PURE__ */ jsxs(
      "span",
      {
        className: match({ isCurrent: stepId === step, isPast: index < stepIndex }).with({ isCurrent: true }, () => "font-medium text-foreground").with({ isPast: true }, () => "cursor-pointer hover:text-foreground").otherwise(() => ""),
        onClick: () => {
          if (index < stepIndex) onNavigate(stepId);
        },
        children: [
          index + 1,
          ". ",
          stepLabels[stepId]
        ]
      }
    )
  ] }, stepId)) });
};
export {
  WizardNav
};
//# sourceMappingURL=WizardNav.js.map
