UNPKG

@react-awesome-query-builder/mui

Version:
23 lines 798 B
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties"; var _excluded = ["confirmFn"]; import { useConfirm } from "material-ui-confirm"; export var MuiUseConfirm = function MuiUseConfirm() { var confirmFn = useConfirm(); return function (_ref) { var okText = _ref.okText, cancelText = _ref.cancelText, title = _ref.title, onOk = _ref.onOk; confirmFn({ description: title || "Are you sure?", title: null, confirmationText: okText || "Ok", cancellationText: cancelText || "Cancel" }).then(onOk)["catch"](function () {}); }; }; export var MuiConfirm = function MuiConfirm(_ref2) { var confirmFn = _ref2.confirmFn, renderOptions = _objectWithoutProperties(_ref2, _excluded); confirmFn(renderOptions); };