import { Dialog as s, DialogBody as r, DialogFooter as l } from "./accelbyte-widgets235.mjs";
import { EcomPath as p } from "./accelbyte-widgets59.mjs";
import e from "react";
import { Trans as a } from "react-i18next";
import { Link as i } from "react-router-dom";
import "./accelbyte-widgets437.mjs";
const m = ({ baseApp: o, onClose: t }) => /* @__PURE__ */ e.createElement(s, { isOpen: !0, className: "purchaseBaseAppDialog" }, /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement(a, { i18nKey: "PurchaseBaseApp.lockedDownloadableContent.content" }, "This expansion requires the base game ", { appTitle: o.title }, " to play")), /* @__PURE__ */ e.createElement(l, { className: "dialogFooter" }, /* @__PURE__ */ e.createElement("button", { onClick: t, className: "btn small btn-ghost btnCancel" }, /* @__PURE__ */ e.createElement(a, { i18nKey: "PurchaseBaseApp.cancel" }, "Cancel")), /* @__PURE__ */ e.createElement(
  i,
  {
    to: p.GameItem.makePath({
      itemId: o.itemId
    }),
    className: "btn small btn-primary btnGoToGamePage"
  },
  /* @__PURE__ */ e.createElement(a, { i18nKey: "PurchaseBaseApp.goToGamePage" }, "Go to the game page")
)));
class D extends e.Component {
  constructor(t) {
    super(t), this.state = {
      isDownloadBaseAppDialogOpen: !1
    };
  }
  render() {
    const { baseApp: t } = this.props, { isDownloadBaseAppDialogOpen: n } = this.state;
    return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("button", { className: "btn big btn-primary btnGoToLibrary", onClick: () => this.setState({ isDownloadBaseAppDialogOpen: !0 }) }, /* @__PURE__ */ e.createElement(a, { i18nKey: "PurchaseBaseApp.goToLibrary" }, "GO TO LIBRARY")), n && /* @__PURE__ */ e.createElement(m, { baseApp: t, onClose: () => this.setState({ isDownloadBaseAppDialogOpen: !1 }) }));
  }
}
export {
  D as PurchaseBaseAppButton
};
