"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ModalCancellationInfo = void 0;
var _locale = require("@mirai/locale");
var _ui = require("@mirai/ui");
var _propTypes = _interopRequireDefault(require("prop-types"));
var _react = _interopRequireDefault(require("react"));
var style = _interopRequireWildcard(require("./ModalCancellationInfo.module.css"));
var _Item = require("../../Item.l10n");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
const ModalCancellationInfo = _ref => {
  let {
    cancellation: {
      paymentConditions,
      title,
      text
    } = {},
    name,
    visible,
    onClose
  } = _ref;
  const {
    translate
  } = (0, _locale.useLocale)();
  const textProps = {
    action: true
  };
  return /*#__PURE__*/_react.default.createElement(_ui.Modal, {
    fit: true,
    title: name,
    visible: visible,
    onClose: onClose,
    onOverflow: onClose,
    className: style.modal
  }, /*#__PURE__*/_react.default.createElement(_ui.View, {
    className: style.content
  }, paymentConditions && /*#__PURE__*/_react.default.createElement(_ui.View, {
    className: style.section
  }, /*#__PURE__*/_react.default.createElement(_ui.Text, {
    bold: true,
    upperCase: true
  }, translate(_Item.L10N.LABEL_PAYMENT_TERMS)), /*#__PURE__*/_react.default.createElement(_ui.Text, textProps, paymentConditions)), /*#__PURE__*/_react.default.createElement(_ui.View, {
    className: style.section
  }, /*#__PURE__*/_react.default.createElement(_ui.Text, {
    bold: true,
    upperCase: true
  }, translate(_Item.L10N.LABEL_CANCELLATION_POLICY)), /*#__PURE__*/_react.default.createElement(_ui.Text, _extends({
    bold: true
  }, textProps), title), /*#__PURE__*/_react.default.createElement(_ui.Text, textProps, text))));
};
exports.ModalCancellationInfo = ModalCancellationInfo;
ModalCancellationInfo.propTypes = {
  cancellation: _propTypes.default.shape({
    text: _propTypes.default.string,
    title: _propTypes.default.string
  }),
  name: _propTypes.default.string,
  paymentConditions: _propTypes.default.string,
  visible: _propTypes.default.bool,
  onClose: _propTypes.default.func
};
ModalCancellationInfo.displayName = 'Mirai:Core:Rates:Item:ModalCancellationInfo';
//# sourceMappingURL=ModalCancellationInfo.js.map