UNPKG

@hitachivantara/uikit-react-core

Version:
40 lines (39 loc) 1.27 kB
import { HvButton } from "../Button/Button.js"; import { HvDialogTitle } from "../Dialog/Title/Title.js"; import { HvDialogContent } from "../Dialog/Content/Content.js"; import { HvDialogActions } from "../Dialog/Actions/Actions.js"; import { HvDialog } from "../Dialog/Dialog.js"; import { jsx, jsxs } from "react/jsx-runtime"; //#region src/QueryBuilder/ConfirmationDialog.tsx var ConfirmationDialog = ({ title, message, onConfirm, onCancel, confirmButtonLabel, cancelButtonLabel, ...others }) => { const handleClose = (_, reason) => { if (reason !== "backdropClick") onCancel?.(); }; return /* @__PURE__ */ jsxs(HvDialog, { onClose: handleClose, ...others, children: [ /* @__PURE__ */ jsx(HvDialogTitle, { variant: "warning", showIcon: false, children: title }), /* @__PURE__ */ jsx(HvDialogContent, { indentContent: true, children: message }), /* @__PURE__ */ jsxs(HvDialogActions, { children: [/* @__PURE__ */ jsx(HvButton, { variant: "primaryGhost", onClick: onConfirm, children: confirmButtonLabel }), /* @__PURE__ */ jsx(HvButton, { autoFocus: true, variant: "primaryGhost", onClick: onCancel, children: cancelButtonLabel })] }) ] }); }; //#endregion export { ConfirmationDialog };