"use client";
import { j as t } from "../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import { useRef as s, useState as m, useEffect as y } from "react";
import o from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.mjs";
import { ReactComponent as n } from "../../assets/images/DownArrow.svg.mjs";
import C from "../Button/index.mjs";
import S from "../Sticker/index.mjs";
import l from "./GameAbout.module.scss.mjs";
const G = ({
  titleSmall: f,
  titleLarge: j,
  description: u,
  gameName: w,
  sticker: c,
  classnames: e,
  buttonLink: r,
  i18n: d
}) => {
  const p = s(null), [g, v] = m(!1), [h, N] = m((r == null ? void 0 : r.expanded) || !1);
  y(() => {
    if (p && p.current) {
      const i = p.current, x = i.scrollHeight > i.clientHeight;
      v(x || h);
    }
  }, [u, h]);
  const a = () => {
    N(!h), r != null && r.onClick && r.onClick();
  };
  return /* @__PURE__ */ t.jsxs("div", { className: o(l.container, e == null ? void 0 : e.container), children: [
    f ? /* @__PURE__ */ t.jsx("div", { className: o("title-sm", e == null ? void 0 : e.titleSmall), children: f }) : null,
    j ? /* @__PURE__ */ t.jsx("div", { className: o("title", e == null ? void 0 : e.titleLarge), children: j }) : null,
    w ? /* @__PURE__ */ t.jsx("div", { className: o("title", e == null ? void 0 : e.gameTitle), children: w }) : null,
    c && c.length > 0 ? /* @__PURE__ */ t.jsx("div", { className: o(l.stickers), children: c.map((i, x) => /* @__PURE__ */ t.jsx(
      S,
      {
        styleType: i.label === "Access Gated" ? "warning" : "tertiary",
        withIcon: i.withIcon,
        variant: "outlined",
        children: i.label
      },
      x
    )) }) : null,
    /* @__PURE__ */ t.jsx(
      "p",
      {
        ref: p,
        className: o(
          "body-sm",
          l.description,
          h ? l.expandedText : l.clampedText,
          e == null ? void 0 : e.description
        ),
        "data-testid": "game-about-description",
        children: u
      }
    ),
    g ? /* @__PURE__ */ t.jsx(
      C,
      {
        className: o("button-sm", l.showMore),
        onClick: a,
        type: "link",
        "data-testid": "show-more-button",
        children: h ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
          (d == null ? void 0 : d.showLess) || "Show less",
          " ",
          /* @__PURE__ */ t.jsx(n, { className: l.iconOpen })
        ] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
          (d == null ? void 0 : d.showMore) || "Show more",
          " ",
          /* @__PURE__ */ t.jsx(n, {})
        ] })
      }
    ) : null
  ] });
};
export {
  G as default
};
//# sourceMappingURL=index.mjs.map
