"use client";
import { j as e } from "../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import r from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.mjs";
import w from "../../utils/useAllImagesLoaded.mjs";
import E from "../AchievementSummaryTable/components/MessageModal/index.mjs";
import j from "../Loading/index.mjs";
import { Tabs as m, getTabsClassNames as I } from "../Tabs/index.mjs";
import o from "./index.module.scss.mjs";
function K({
  games: n,
  imagesToPreload: x,
  filterProps: p,
  isFetching: a,
  hasFetchedAll: f,
  fetchNextPage: d,
  onScrollList: s,
  className: g,
  isPageLoading: v,
  tabs: c,
  messageModalProps: h,
  activeTab: T,
  pageTitle: b,
  classNames: t,
  searchBar: B,
  listContainerId: C,
  ...F
}) {
  const M = (i) => {
    const { scrollHeight: y, scrollTop: A, clientHeight: H } = i.target;
    s == null || s(i), y - A - H < 5e3 && !a && !f && d !== void 0 && d();
  }, R = w(x), u = /* @__PURE__ */ e.jsx("div", { className: r(o.gamesTable, t == null ? void 0 : t.gamesTable), children: n });
  let l = null;
  return v || !R ? l = /* @__PURE__ */ e.jsx(j, {}) : a ? l = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
    u,
    /* @__PURE__ */ e.jsx(j, {})
  ] }) : n == null || n.length === 0 ? l = /* @__PURE__ */ e.jsx(
    E,
    {
      title: h.title,
      message: h.message,
      className: o.messageModal
    }
  ) : l = u, /* @__PURE__ */ e.jsxs("div", { className: r(o.container, g), ...F, children: [
    /* @__PURE__ */ e.jsx("h5", { className: r(o.title, t == null ? void 0 : t.title), children: b }),
    /* @__PURE__ */ e.jsx("div", { className: o.topBar, children: /* @__PURE__ */ e.jsxs(
      m,
      {
        value: T,
        onChange: (i) => p.setActiveFilter(i),
        mah: "100%",
        className: o.secondTopRowContainer,
        classNames: I({}, { list: "outline" }),
        children: [
          c.length > 0 ? /* @__PURE__ */ e.jsx(m.List, { children: c.map((i) => /* @__PURE__ */ e.jsx(
            m.Tab,
            {
              value: i.value,
              className: o.tab,
              children: /* @__PURE__ */ e.jsx("div", { className: "menu-item", children: i.label })
            },
            i.value
          )) }) : null,
          B
        ]
      }
    ) }),
    /* @__PURE__ */ e.jsx(
      "div",
      {
        className: r(o.games, t == null ? void 0 : t.list),
        id: C,
        onScroll: M,
        children: l
      }
    )
  ] });
}
export {
  K as QuestsSummaryTable
};
//# sourceMappingURL=index.mjs.map
