"use client";
import { j as e } from "../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import { createElement as A } from "react";
import d from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.mjs";
import { DarkContainer as R } from "../DarkContainer/index.mjs";
import h from "../Loading/index.mjs";
import { PointsBalance as T } from "../PointsBalance/index.mjs";
import { Tabs as i, getTabsClassNames as y } from "../Tabs/index.mjs";
import u from "./components/QuestItem/index.mjs";
import a from "./index.module.scss.mjs";
function B({
  quests: n,
  loading: C,
  i18n: t = {
    quests: "Quests",
    claimed: "Claimed",
    readyForClaim: "Ready for Claim",
    active: "Active",
    type: {
      "REPUTATIONAL-AIRDROP": "Reputation",
      PLAYSTREAK: "Play Streak",
      LEADERBOARD: "Leaderboard"
    },
    pointsClaimed: "Points Claimed"
  },
  className: p,
  pointsProps: r,
  ...b
}) {
  const N = n.filter((s) => s.state === "ACTIVE").map((s) => /* @__PURE__ */ e.jsx(u, { info: s, i18n: t, onClick: s.onClick }, s.id)), v = n.filter((s) => s.state === "CLAIMED").map((s) => /* @__PURE__ */ e.jsx(u, { info: s, i18n: t, onClick: s.onClick }, s.id)), m = n.filter((s) => s.state === "READY_FOR_CLAIM").map((s) => /* @__PURE__ */ e.jsx(u, { info: s, i18n: t, onClick: s.onClick }, s.id)), x = m.length;
  let j = null;
  x > 0 && (j = /* @__PURE__ */ e.jsx("div", { className: d("menu", a.counter), children: x }));
  let o = null;
  if (C)
    o = /* @__PURE__ */ e.jsx(h, { className: a.loader });
  else {
    let s = null, l = null;
    m.length > 0 && (l = /* @__PURE__ */ e.jsx("div", { className: a.sectionTitle, children: t.active }), s = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
      /* @__PURE__ */ e.jsx("div", { className: a.sectionTitle, children: t.readyForClaim }),
      /* @__PURE__ */ e.jsx("div", { className: a.questItemsContainer, children: m })
    ] })), o = /* @__PURE__ */ e.jsxs("div", { children: [
      s,
      l,
      /* @__PURE__ */ e.jsx("div", { className: a.questItemsContainer, children: N })
    ] });
  }
  let c = null;
  C ? c = /* @__PURE__ */ e.jsx(h, { className: a.loader }) : c = /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("div", { className: a.questItemsContainer, children: v }) });
  let f = null;
  if (r && r.length) {
    const s = r.map((l) => /* @__PURE__ */ A(T, { ...l, key: l.symbol }));
    f = /* @__PURE__ */ e.jsxs("div", { className: a.pointsClaimedContainer, children: [
      /* @__PURE__ */ e.jsx("div", { className: d("menu-item", a.pointsClaimedTitle), children: t.pointsClaimed }),
      /* @__PURE__ */ e.jsx("div", { className: a.pointsBalanceContainer, children: s })
    ] });
  }
  return /* @__PURE__ */ e.jsxs(
    R,
    {
      className: d(a.darkContainer, p),
      ...b,
      children: [
        /* @__PURE__ */ e.jsxs(
          i,
          {
            defaultValue: "tab1",
            classNames: y(
              { list: a.tabsList, root: a.tabsRoot },
              { tab: "secondary" }
            ),
            children: [
              /* @__PURE__ */ e.jsxs(i.List, { children: [
                /* @__PURE__ */ e.jsx(i.Tab, { value: "tab1", children: /* @__PURE__ */ e.jsxs("div", { className: "menu", children: [
                  t.quests,
                  j
                ] }) }),
                /* @__PURE__ */ e.jsx(i.Tab, { value: "tab2", children: /* @__PURE__ */ e.jsx("div", { className: "menu", children: t.claimed }) })
              ] }),
              /* @__PURE__ */ e.jsx(i.Panel, { value: "tab1", children: o }),
              /* @__PURE__ */ e.jsx(i.Panel, { value: "tab2", children: c })
            ]
          }
        ),
        f
      ]
    }
  );
}
export {
  B as default
};
//# sourceMappingURL=index.mjs.map
