import { jsx as l, jsxs as v } from "react/jsx-runtime";
import { useState as S, useEffect as h } from "react";
import { Nav as m } from "react-bootstrap";
import i from "../../utils/classNames.js";
const o = (p) => {
  const {
    labels: N,
    selectedStepNumber: e,
    onSelectedChanged: g,
    variant: r = "circle",
    disableFollowingPages: a,
    mobileBreakpoint: b = !0,
    className: n = ""
  } = p, [c, d] = S(
    a || e
  );
  h(() => {
    if (a !== void 0) {
      if (a < e) {
        console.warn(
          `Invalid component state detected in SteppedProgressBar: can not disable following pages ${a} when selectedStep is ${e}!`
        );
        return;
      }
      d(a);
    } else e > c && d(e);
  }, [a, e]);
  const f = i(
    "stepped-progress-bar",
    r && `variant-${r}`,
    b && "mobile-breakpoint",
    n && n
  );
  return /* @__PURE__ */ l(m, { className: f, activeKey: e, onSelect: (s) => g(Number(s)), children: N.map((s, t) => /* @__PURE__ */ l(
    m.Link,
    {
      eventKey: t,
      disabled: t > c,
      as: "a",
      className: i("step-tab", s.labelWrapperClassName),
      children: /* @__PURE__ */ v("div", { className: "step-tab-content", children: [
        /* @__PURE__ */ l("div", { className: "item-icon", children: s.icon }),
        /* @__PURE__ */ l("div", { className: i("item-label", s.labelClassName), children: s.label })
      ] })
    },
    t
  )) });
};
o.VARIANT_CIRCLE = "circle";
o.VARIANT_RECTANGLE = "rectangle";
o.VARIANT_ROADSIGN = "roadsign";
export {
  o as default
};
//# sourceMappingURL=SteppedProgressBar.js.map
