UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

60 lines (59 loc) 1.28 kB
import { jsx as t, jsxs as m, Fragment as u } from "react/jsx-runtime"; import { Button as s } from "@mui/material"; import { DialogBase as C } from "../DialogBase.js"; import { defaults as e } from "lodash-es"; const B = "Cancel", f = { children: "OK", color: "primary", variant: "contained" }, P = { children: B, variant: "outlined" }, T = (n) => { const { onConfirm: r, onCancel: o, hasCancelButton: c = !0 } = n, i = e( {}, n.confirmButtonProps, f ), a = e( {}, n.cancelButtonProps, P ); return /* @__PURE__ */ m(u, { children: [ c && /* @__PURE__ */ t(s, { ...a, onClick: o }), /* @__PURE__ */ t(s, { ...i, onClick: r }) ] }); }; function N(n) { const { onConfirm: r, onCancel: o, hasCancelButton: c, confirmButtonProps: i, cancelButtonProps: a, ...l } = n; return /* @__PURE__ */ t( C, { onCancel: o, actions: /* @__PURE__ */ t( T, { confirmButtonProps: i, cancelButtonProps: a, onConfirm: r, onCancel: o, hasCancelButton: c } ), ...l } ); } export { B as CANCEL_BUTTON_TEXT, T as ConfirmationButtons, N as ConfirmationDialog }; //# sourceMappingURL=ConfirmationDialog.js.map