"use strict";

exports.__esModule = true;
exports.default = void 0;
var _template2 = _interopRequireDefault(require("lodash/fp/template"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _provider = _interopRequireDefault(require("../../atom/provider"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const ProductCard = (props, context) => {
  const {
    title,
    subtitle,
    price,
    currency,
    checkImage
  } = props;
  const {
    translate
  } = context;
  const descriptionItemTranslationKeys = [translate('product_desc_culture'), translate('product_desc_partnership'), translate('product_desc_battle'), translate('product_desc_coach'), translate('product_desc_forum'), translate('product_desc_certificates')];
  const priceTemplate = translate('subscription_price');
  const priceValue = (0, _template2.default)(priceTemplate)({
    price,
    currency
  });
  const items = descriptionItemTranslationKeys.map((itemDescription, index) => {
    return /*#__PURE__*/_react.default.createElement("div", {
      className: _style.default.productDescriptionItem,
      key: index
    }, /*#__PURE__*/_react.default.createElement("img", {
      className: _style.default.productCheckbox,
      src: checkImage
    }), /*#__PURE__*/_react.default.createElement("div", {
      className: _style.default.productDescriptionText
    }, itemDescription));
  });
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.product
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.productHeader
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.productHeaderTitle
  }, title), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.productHeaderSubtitle
  }, subtitle)), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.productBody
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: "product__description"
  }, items), /*#__PURE__*/_react.default.createElement("hr", {
    className: _style.default.productSeparation
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.productPrice
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.priceValue
  }, priceValue), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.cancelText
  }, translate('product_cancel')))));
};
ProductCard.contextTypes = {
  translate: _provider.default.childContextTypes.translate
};
ProductCard.propTypes = process.env.NODE_ENV !== "production" ? {
  title: _propTypes.default.string.isRequired,
  subtitle: _propTypes.default.string.isRequired,
  currency: _propTypes.default.string.isRequired,
  price: _propTypes.default.string.isRequired,
  checkImage: _propTypes.default.string.isRequired
} : {};
var _default = exports.default = ProductCard;
//# sourceMappingURL=index.js.map