"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { Check } from "lucide-react";
import { cn } from "@open-mercato/shared/lib/utils";
import { useT } from "@open-mercato/shared/lib/i18n/context";
function activeStep(status) {
  if (!status) return 1;
  if (status === "pending" || status === "dns_failed") return 2;
  if (status === "verified" || status === "tls_failed") return 3;
  if (status === "active") return 4;
  return 1;
}
function DefaultStepper({ status }) {
  const t = useT();
  const current = activeStep(status);
  const steps = [
    { idx: 1, label: t("customer_accounts.domainMapping.stepper.step1", "Register Domain") },
    { idx: 2, label: t("customer_accounts.domainMapping.stepper.step2", "Configure DNS") },
    { idx: 3, label: t("customer_accounts.domainMapping.stepper.step3", "SSL Certificate") },
    { idx: 4, label: t("customer_accounts.domainMapping.stepper.step4", "Live") }
  ];
  return /* @__PURE__ */ jsx("ol", { className: "flex flex-wrap items-center gap-3 text-sm", children: steps.map((step, index) => {
    const isDone = step.idx < current;
    const isCurrent = step.idx === current;
    return /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-3", children: [
      /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
        /* @__PURE__ */ jsx(
          "span",
          {
            className: cn(
              "flex h-7 w-7 items-center justify-center rounded-full border text-xs font-medium",
              isDone && "border-status-success-icon bg-status-success-icon text-status-success-foreground",
              isCurrent && "border-primary bg-primary/10 text-primary",
              !isDone && !isCurrent && "border-border bg-background text-muted-foreground"
            ),
            "aria-current": isCurrent ? "step" : void 0,
            children: isDone ? /* @__PURE__ */ jsx(Check, { className: "h-4 w-4", "aria-hidden": true }) : step.idx
          }
        ),
        /* @__PURE__ */ jsx(
          "span",
          {
            className: cn(
              "whitespace-nowrap",
              isCurrent ? "font-medium text-foreground" : "text-muted-foreground"
            ),
            children: step.label
          }
        )
      ] }),
      index < steps.length - 1 ? /* @__PURE__ */ jsx("span", { className: "hidden h-px w-8 bg-border sm:block", "aria-hidden": true }) : null
    ] }, step.idx);
  }) });
}
var Stepper_default = DefaultStepper;
export {
  DefaultStepper,
  Stepper_default as default
};
//# sourceMappingURL=Stepper.js.map
