function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

/**
 * 公共弹出框
 * 常用属性：
 * title：弹出框标题
 * size：弹出框枚举宽度，medium：中等 small：小型 mini：超小 默认medium
 * onCancel：取消按钮回调
 * onOK：确定按钮回调
 * 使用示例：平台商家管理@pages/BusinessCenter/SellerOnPlatform
 */
import { Modal } from '@whalecloud/fdx';
import React from 'react';
import { size } from './const';

function CommonModal(_ref) {
  var modalOpts = _ref.modalOpts,
      onOk = _ref.onOk,
      onCancel = _ref.onCancel,
      visible = _ref.visible,
      children = _ref.children,
      okText = _ref.okText,
      cancelText = _ref.cancelText,
      confirmLoading = _ref.confirmLoading;
  var modalCommonProps = {
    title: "Modal",
    visible: visible,
    width: size.NORMAL,
    wrapClassName: 'modal-container',
    centered: true,
    maskClosable: false,
    destroyOnClose: true,
    okText: okText || "Confirm",
    cancelText: cancelText || "Cancel"
  };
  return /*#__PURE__*/React.createElement(Modal, _extends({}, modalCommonProps, modalOpts, {
    onOk: onOk,
    onCancel: onCancel,
    confirmLoading: confirmLoading
  }), children);
}

export default CommonModal;