@blocklet/payment-react
Version:
Reusable react components for payment kit v2
37 lines (36 loc) • 944 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
module.exports = SubmitButton;
var _jsxRuntime = require("react/jsx-runtime");
var _material = require("@mui/material");
var _format = require("../../utils/format");
function SubmitButton({
canSubmit,
isProcessing,
isWaitingStripe,
label,
processingLabel,
onSubmit
}) {
return /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.Button, {
variant: "contained",
size: "large",
fullWidth: true,
disabled: !canSubmit || isWaitingStripe,
onClick: onSubmit,
startIcon: isProcessing ? /* @__PURE__ */(0, _jsxRuntime.jsx)(_material.CircularProgress, {
size: 20,
color: "inherit"
}) : null,
sx: {
py: 1.5,
fontSize: "1.3rem",
fontWeight: 600,
textTransform: "none",
color: theme => (0, _format.primaryContrastColor)(theme)
},
children: isProcessing ? processingLabel : label
});
}