import { jsx as e, jsxs as p } from "react/jsx-runtime";
import { useState as u, useEffect as f } from "react";
import { setupProgressItems as o } from "../schemas.js";
import d from "../../../hooks/useStepperHandlers.js";
import g from "../../../hooks/useStepperBeforeNavigate.js";
import t from "../../../../box/Box.js";
import l from "../../../../icon/Icon.js";
import v from "../../../../text/Text.js";
const x = ({ id: h }) => {
  const { getAllData: n } = d(), [s, m] = u(0);
  return g((r) => {
    r.type === "next" && console.log("[SetupStep] submitting all data:", n());
  }), f(() => {
    if (s >= o.length) return;
    const r = setTimeout(() => {
      m((a) => a + 1);
    }, 1200);
    return () => clearTimeout(r);
  }, [s]), /* @__PURE__ */ e(t, { className: "flex flex-col gap-[var(--spacing-6)]", children: /* @__PURE__ */ e(t, { className: "w-full flex justify-center", children: /* @__PURE__ */ e(t, { className: "flex flex-col gap-[var(--spacing-4)] items-start py-[var(--spacing-6)]", children: o.map((r, a) => {
    const i = a < s, c = a === s;
    return /* @__PURE__ */ p(t, { className: "flex items-center gap-[var(--spacing-3)]", children: [
      i ? /* @__PURE__ */ e(t, { className: "flex items-center justify-center w-[var(--spacing-8)] h-[var(--spacing-8)] rounded-full bg-[var(--base-success-background)] text-[var(--base-success-text)]", children: /* @__PURE__ */ e(l, { name: "Check", size: 16 }) }) : /* @__PURE__ */ e(t, { className: "flex items-center justify-center w-[var(--spacing-8)] h-[var(--spacing-8)] rounded-full border border-[var(--base-border)]", children: c ? /* @__PURE__ */ e(l, { name: "Loader2", size: 16, animation: "spin" }) : /* @__PURE__ */ e(t, { className: "w-[var(--spacing-2)] h-[var(--spacing-2)] rounded-full bg-[var(--base-muted-foreground)]" }) }),
      /* @__PURE__ */ e(v, { type: i ? "muted" : void 0, weight: c ? "semibold" : "regular", children: r })
    ] }, r);
  }) }) }) });
};
x.displayName = "SetupStep";
export {
  x as default
};
//# sourceMappingURL=SetupStep.js.map
