"use client";
import { j as e } from "../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import { useState as b, useEffect as E } from "react";
import c from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.mjs";
import { ReactComponent as T } from "../../assets/images/EditorChoice.svg.mjs";
import $ from "../MetaSection/index.mjs";
import V from "../SocialLinks/SocialLinks.mjs";
import r from "../Sticker/index.mjs";
import s from "./GameInfoV2.module.scss.mjs";
import { parseNumIntoReadableString as z, bytesUnits as A } from "../../../node_modules/.pnpm/@hyperplay_utils@0.3.18/node_modules/@hyperplay/utils/dist/index.es.mjs";
const M = ({
  title: y,
  info: o,
  version: d,
  earlyAccess: h,
  playerCount: m,
  downloadSizeInBytes: u,
  ImageComponent: i,
  blockchains: N,
  socialLinks: x,
  editorChoice: a,
  actionButton: g,
  isLoading: f,
  className: S,
  i18n: l = {
    editorChoice: "Editor's Choice",
    version: "Version",
    earlyAccess: "Early Access",
    developer: "Developer",
    playerCount: "Player Count",
    size: "Size"
  }
}) => {
  const [t, v] = b(f);
  E(() => {
    i && !t && v(!1), !i && t && v(!0);
  }, [i, t]);
  let j = null;
  if (a != null && a.isEditorChoice) {
    let p = l.editorChoice;
    a.year && (p = `${l.editorChoice} ${a.year}`), j = /* @__PURE__ */ e.jsxs("div", { className: c(s.editorChoice, a.className), children: [
      /* @__PURE__ */ e.jsx(T, {}),
      p
    ] });
  }
  let n = null;
  return u && (n = z({
    num: u,
    units: A,
    minValue: "0.0001",
    maxValue: "1"
  })), /* @__PURE__ */ e.jsxs("div", { className: c(s.container, S), children: [
    /* @__PURE__ */ e.jsx("div", { className: s.imageContainer, children: f ? /* @__PURE__ */ e.jsx("div", { className: s.imageLoading }) : i }),
    /* @__PURE__ */ e.jsxs("div", { className: s.body, children: [
      /* @__PURE__ */ e.jsxs("div", { className: s.content, children: [
        /* @__PURE__ */ e.jsxs("div", { className: s.header, children: [
          j,
          /* @__PURE__ */ e.jsx("span", { className: c(s.title), children: y })
        ] }),
        /* @__PURE__ */ e.jsxs("div", { className: s.info, children: [
          /* @__PURE__ */ e.jsx("div", { className: s.badges, children: /* @__PURE__ */ e.jsx(
            $,
            {
              title: "",
              items: [
                d ? /* @__PURE__ */ e.jsx(
                  r,
                  {
                    styleType: "neutral",
                    variant: "filledStrong",
                    children: `${l.version}: ${d}`
                  },
                  l.version
                ) : null,
                h ? /* @__PURE__ */ e.jsx(
                  r,
                  {
                    styleType: "neutral",
                    variant: "filledStrong",
                    children: l.earlyAccess
                  },
                  l.earlyAccess
                ) : null,
                o.developer ? /* @__PURE__ */ e.jsx(
                  r,
                  {
                    styleType: "neutral",
                    variant: "filledStrong",
                    children: o.developer
                  },
                  l.developer
                ) : null,
                m ? /* @__PURE__ */ e.jsx(
                  r,
                  {
                    styleType: "neutral",
                    variant: "filledStrong",
                    children: m
                  },
                  l.playerCount
                ) : null,
                n ? /* @__PURE__ */ e.jsx(
                  r,
                  {
                    styleType: "neutral",
                    variant: "filledStrong",
                    children: `${l.size}: ${n}`
                  },
                  "download-size-sticker"
                ) : null
              ],
              maxVisibleItems: 8,
              moreIndicator: /* @__PURE__ */ e.jsx(e.Fragment, {})
            }
          ) }),
          N
        ] })
      ] }),
      /* @__PURE__ */ e.jsxs("div", { className: s.actions, children: [
        x && /* @__PURE__ */ e.jsx(V, { socialLinks: x }),
        g
      ] })
    ] })
  ] });
};
export {
  M as default
};
//# sourceMappingURL=index.mjs.map
