UNPKG

@jay.kou/rak-ssr

Version:

A react based UI components for admin system

25 lines 815 B
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; var _excluded = ["children", "title", "content", "onOk"]; import { Modal } from 'antd'; import React from 'react'; var confirm = Modal.confirm; var ModalConfirm = function ModalConfirm(props) { var children = props.children, title = props.title, content = props.content, onOk = props.onOk, rest = _objectWithoutProperties(props, _excluded); var showConfirm = function showConfirm(e) { e.stopPropagation(); confirm(_objectSpread({ title: title, content: content, onOk: onOk }, rest)); }; return /*#__PURE__*/React.cloneElement(children, { onClick: showConfirm }); }; export default ModalConfirm;