@blocklet/payment-react
Version:
Reusable react components for payment kit v2
50 lines (49 loc) • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
module.exports = ConfirmDialog;
var _jsxRuntime = require("react/jsx-runtime");
var _Dialog = require("@arcblock/ux/lib/Dialog");
var _context = require("@arcblock/ux/lib/Locale/context");
var _material = require("@mui/material");
function ConfirmDialog({
onConfirm,
onCancel,
title,
message,
confirm = "",
color = "error",
cancel = "",
loading = false
}) {
const {
t
} = (0, _context.useLocaleContext)();
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_Dialog.Confirm, {
open: true,
title,
onConfirm,
onCancel,
confirmButton: {
text: confirm || t("common.confirm"),
props: {
color,
size: "small",
variant: "contained",
disabled: !!loading
}
},
cancelButton: {
text: cancel || t("common.cancel"),
props: {
color: "inherit",
size: "small"
}
},
showCancelButton: typeof cancel !== "boolean" || !!cancel,
children: /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Box, {
children: message
})
});
}