import React from 'react';
import { Button, Space } from 'antd';
import { PisellModal } from '@pisell/materials';
import { locales } from '@pisell/utils';
import "./index.less";

/**
 * 折扣变更弹窗 Props
 */

/**
 * 折扣变更弹窗组件
 *
 * @description 当订单中使用的商品折扣已失效时，弹出此弹窗让用户选择处理方式
 * @author Pisell Team
 */
var DiscountChangeModal = function DiscountChangeModal(_ref) {
  var open = _ref.open,
    onKeepOriginal = _ref.onKeepOriginal,
    onContinue = _ref.onContinue,
    onRemove = _ref.onRemove,
    onCancel = _ref.onCancel;
  /**
   * 渲染自定义底部按钮
   */
  var renderFooter = function renderFooter() {
    return /*#__PURE__*/React.createElement("div", {
      className: "discount-change-modal__footer"
    }, /*#__PURE__*/React.createElement(Space, {
      size: 12,
      wrap: true
    }, /*#__PURE__*/React.createElement(Button, {
      type: "primary",
      onClick: onContinue
    }, locales.getText('pisell2.discount-change.continue')), /*#__PURE__*/React.createElement(Button, {
      onClick: onRemove
    }, locales.getText('pisell2.discount-change.remove')), /*#__PURE__*/React.createElement(Button, {
      onClick: onCancel
    }, locales.getText('pisell2.discount-change.cancel'))));
  };
  return /*#__PURE__*/React.createElement(PisellModal, {
    open: open,
    title: locales.getText('pisell2.discount-change.title'),
    onCancel: onCancel,
    footer: renderFooter(),
    maskClosable: false,
    width: 560,
    destroyOnClose: true
  }, /*#__PURE__*/React.createElement("div", {
    className: "discount-change-modal__content"
  }, /*#__PURE__*/React.createElement("p", {
    className: "discount-change-modal__desc"
  }, locales.getText('pisell2.discount-change.desc')), /*#__PURE__*/React.createElement("ul", {
    className: "discount-change-modal__reasons"
  }, /*#__PURE__*/React.createElement("li", null, locales.getText('pisell2.discount-change.reason'))), /*#__PURE__*/React.createElement("p", {
    className: "discount-change-modal__desc"
  }, locales.getText('pisell2.discount-change.options-title')), /*#__PURE__*/React.createElement("ul", {
    className: "discount-change-modal__options"
  }, /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("strong", null, locales.getText('pisell2.discount-change.continue')), "\uFF1A", locales.getText('pisell2.discount-change.continue-desc')), /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("strong", null, locales.getText('pisell2.discount-change.remove')), "\uFF1A", locales.getText('pisell2.discount-change.remove-desc')))));
};
export default DiscountChangeModal;