import { Button as o, ButtonStyle as c, ButtonType as d } from "./accelbyte-widgets107.mjs";
import { Dialog as f, DialogBody as p, DialogFooter as u } from "./accelbyte-widgets235.mjs";
import { t as a } from "./accelbyte-widgets58.mjs";
import t from "react";
class E extends t.Component {
  constructor(e) {
    super(e), this.onClickConfirm = async () => {
      this.setState({ isLoading: !0 });
      try {
        await this.props.onConfirm();
      } finally {
        this.setState({ isLoading: !1 });
      }
    }, this.state = {
      isLoading: !1
    };
  }
  render() {
    const { title: e, message: i, onCancel: s, isOpen: l, cancelBtnLabel: r, confirmBtnLabel: m } = this.props, { isLoading: n } = this.state;
    return /* @__PURE__ */ t.createElement(f, { title: e, isOpen: l, className: "w-400" }, /* @__PURE__ */ t.createElement(p, null, /* @__PURE__ */ t.createElement("div", { className: "mb-5 text-sm" }, i)), /* @__PURE__ */ t.createElement(u, null, /* @__PURE__ */ t.createElement("div", { className: "flex justify-end" }, /* @__PURE__ */ t.createElement(
      o,
      {
        className: "btn btn-ghost mr-2 h-10 w-24",
        onClick: s,
        buttonStyle: c.NONE,
        buttonType: d.TEXT,
        disabled: n
      },
      r || a("Common.cancel")
    ), /* @__PURE__ */ t.createElement(
      o,
      {
        loadingIndicator: "SPINNER",
        disabled: n,
        className: "btn btn-primary h-10 w-28",
        isLoading: n,
        onClick: this.onClickConfirm
      },
      m || a("Common.confirm")
    ))));
  }
}
export {
  E as ConfirmationDialog
};
