import e, { useEffect as p } from "react";
import { Modal as w } from "./accelbyte-widgets635.mjs";
import { Trans as l } from "react-i18next";
import "./accelbyte-widgets638.mjs";
import { ItemList as E } from "./accelbyte-widgets639.mjs";
import { Typography as v } from "./accelbyte-widgets173.mjs";
import { XCircle as g } from "react-feather";
import n from "classnames";
function M(m) {
  const { logo: o, visible: c, isPreview: t, gameName: s, dropItems: d, onClose: a, isMultipleGame: r } = m;
  return p(() => {
    const i = (u) => {
      u.key === "Escape" && a();
    };
    return window.addEventListener("keydown", i), () => {
      window.removeEventListener("keydown", i);
    };
  }, []), /* @__PURE__ */ e.createElement(
    w,
    {
      visible: c,
      className: n("twitchDropPage__successModal", t ? "inPreview" : "", r ? "multipleGame" : ""),
      isPreviewMode: t,
      overlayBackground: t ? { position: "absolute" } : void 0
    },
    /* @__PURE__ */ e.createElement("div", { className: "containertwitch" }, /* @__PURE__ */ e.createElement("div", { className: "containertwitch" }, /* @__PURE__ */ e.createElement("button", { className: "closeButton" }, /* @__PURE__ */ e.createElement(g, { onClick: a }), /* @__PURE__ */ e.createElement("span", null, "Esc"))), o && /* @__PURE__ */ e.createElement("div", { className: "twitchDropLayout__logo" }, /* @__PURE__ */ e.createElement("img", { src: o, alt: "logo" })), /* @__PURE__ */ e.createElement(v, { tag: "h1", className: "twitchDropLayout__title" }, /* @__PURE__ */ e.createElement(l, { i18nKey: "TwitchDropPage.claim.modal.congratulations" }, "Congratulations!")), /* @__PURE__ */ e.createElement(l, { i18nKey: "TwitchDropPage.claim.modal.success" }, "You`ve claimed your drops for the ", /* @__PURE__ */ e.createElement("b", null, { gameName: s }), " game.", /* @__PURE__ */ e.createElement("br", null), "The items will be sent to your in-game inventory."), /* @__PURE__ */ e.createElement("div", { className: n("listContainer", t ? "inPreview" : "") }, /* @__PURE__ */ e.createElement(E, { items: d, isMultipleGame: r, isPreviewMode: t })))
  );
}
export {
  M as SuccessModal
};
