synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
86 lines (85 loc) • 2.25 kB
JavaScript
import { jsx as i, jsxs as c, Fragment as a } from "react/jsx-runtime";
import { Button as r, Box as f, Alert as B } from "@mui/material";
import { DialogBase as S } from "../DialogBase.js";
import { SynapseSpinner as h } from "../LoadingScreen/LoadingScreen.js";
import v from "../SpinnerButton/SpinnerButton.js";
function b({
errorMessage: t,
onCancel: o,
onConfirm: e,
confirming: d,
onStepChange: l,
open: u,
step: n,
content: x,
loading: m
}) {
if (!n) return null;
const p = /* @__PURE__ */ i(
f,
{
sx: {
display: "flex",
flexDirection: "column",
gap: 1
},
children: /* @__PURE__ */ c(a, { children: [
m ? /* @__PURE__ */ i(h, { size: 40 }) : x,
t && /* @__PURE__ */ i(B, { severity: "error", children: t })
] })
}
);
return /* @__PURE__ */ i(
S,
{
actions: /* @__PURE__ */ c(a, { children: [
n?.cancelButtonText && /* @__PURE__ */ i(r, { variant: "outlined", onClick: () => o(), children: n.cancelButtonText }),
n?.previousStep && /* @__PURE__ */ i(
r,
{
variant: "outlined",
color: "primary",
onClick: () => n.previousStep ? l(n.previousStep) : null,
children: "Back"
}
),
n?.nextStep && /* @__PURE__ */ i(
r,
{
variant: "contained",
color: "primary",
disabled: !n.nextEnabled,
onClick: () => n.nextStep ? l(n.nextStep) : null,
children: "Next"
}
),
e && n?.confirmButtonText && /* @__PURE__ */ i(
v,
{
variant: "contained",
color: "primary",
disabled: !n.confirmEnabled,
onClick: () => {
e();
},
showSpinner: d === !0,
sx: { marginLeft: "8px" },
children: n.confirmButtonText
}
)
] }),
content: p,
onCancel: o,
open: u,
title: n.title,
sx: {
h2: { paddingTop: 0, paddingBottom: "20px" }
},
contentProps: n.contentProps
}
);
}
export {
b as default
};
//# sourceMappingURL=StepperDialog.js.map