"use client";
import { j as i } 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 { CardGeneric as z } from "../CardGeneric/index.mjs";
import t from "./index.module.scss.mjs";
import { Tooltip as u } from "@mantine/core";
import { useShowTooltipOnOverflow as w } from "../../utils/useShowTooltipOnOverflow.mjs";
function E({
  title: f,
  description: n,
  questName: e,
  questType: l,
  gameTitle: v,
  rewardImage: x,
  currencyAmount: h,
  currencyName: d,
  classNames: o,
  className: j,
  selected: b,
  ...R
}) {
  const p = {};
  p[t.selected] = !!b;
  const { elementRef: y, showTooltip: C } = w(), { elementRef: T, showTooltip: g } = w(), { elementRef: S, showTooltip: q } = w();
  return /* @__PURE__ */ i.jsx(
    z,
    {
      className: r(t.card, j),
      genericClassNames: {
        body: r(t.body, p),
        image: r(t.image, o == null ? void 0 : o.image),
        root: r(t.root, o == null ? void 0 : o.root),
        label: r(t.questType, o == null ? void 0 : o.questType)
      },
      i18n: {
        label: l
      },
      showLabel: !!l,
      ...R,
      children: /* @__PURE__ */ i.jsxs("div", { className: r(t.content), children: [
        /* @__PURE__ */ i.jsxs("div", { className: r(t.header), children: [
          f ? /* @__PURE__ */ i.jsx("div", { className: r(t.title, "menu-item", o == null ? void 0 : o.title), children: f }) : null,
          v ? /* @__PURE__ */ i.jsx(
            "div",
            {
              className: r(
                t.subtitle,
                "caption-sm",
                o == null ? void 0 : o.subtitle
              ),
              children: v
            }
          ) : null,
          n ? /* @__PURE__ */ i.jsx(
            u,
            {
              arrowSize: 16,
              position: "bottom",
              arrowPosition: "center",
              withArrow: !0,
              label: n,
              className: r(t.tooltip, { [t.show]: C }),
              events: { hover: !0, touch: !0, focus: !1 },
              children: /* @__PURE__ */ i.jsx(
                "div",
                {
                  className: r(
                    t.description,
                    "eyebrow",
                    o == null ? void 0 : o.description
                  ),
                  ref: y,
                  children: n
                }
              )
            }
          ) : null,
          e ? /* @__PURE__ */ i.jsx(
            u,
            {
              arrowSize: 16,
              position: "bottom",
              arrowPosition: "center",
              withArrow: !0,
              label: e,
              className: r(t.tooltip, {
                [t.show]: q
              }),
              events: { hover: !0, touch: !0, focus: !1 },
              children: /* @__PURE__ */ i.jsx(
                "div",
                {
                  ref: S,
                  className: r(
                    t.questName,
                    "title-sm",
                    o == null ? void 0 : o.questName
                  ),
                  children: e
                }
              )
            }
          ) : null
        ] }),
        h || d ? /* @__PURE__ */ i.jsxs("div", { className: r(t.questsDetails, o == null ? void 0 : o.questDetails), children: [
          /* @__PURE__ */ i.jsxs("div", { className: r(t.avatarWithName), children: [
            /* @__PURE__ */ i.jsx(
              "div",
              {
                className: r(
                  t.avatarContainer,
                  o == null ? void 0 : o.avatarContainer
                ),
                children: /* @__PURE__ */ i.jsx(
                  "img",
                  {
                    src: x,
                    alt: `${e} Reward Image`,
                    className: r(t.avatar, o == null ? void 0 : o.avatar)
                  }
                )
              }
            ),
            /* @__PURE__ */ i.jsx(
              u,
              {
                arrowSize: 16,
                position: "bottom",
                arrowPosition: "center",
                withArrow: !0,
                label: d,
                className: r(t.tooltip, {
                  [t.show]: g
                }),
                events: { hover: !0, touch: !0, focus: !1 },
                children: /* @__PURE__ */ i.jsx(
                  "div",
                  {
                    ref: T,
                    className: r(
                      t.currencyName,
                      "body-sm",
                      o == null ? void 0 : o.currencyName
                    ),
                    children: d
                  }
                )
              }
            )
          ] }),
          h && /* @__PURE__ */ i.jsx("div", { className: r(t.amount, o == null ? void 0 : o.currencyAmount), children: h })
        ] }) : null
      ] })
    }
  );
}
export {
  E as QuestCard
};
//# sourceMappingURL=index.mjs.map
