"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _provider = _interopRequireDefault(require("../../atom/provider"));
var _link = _interopRequireDefault(require("../../atom/link"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const Unsubscribe = (props, context) => {
  const {
    translate
  } = context;
  const {
    moocUrl,
    hasUnsubscribed,
    onUnsubscribeButtonClick
  } = props;
  return /*#__PURE__*/_react.default.createElement("div", null, !hasUnsubscribed ? /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.unsubscribe
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.description
  }, translate('confirm_unsubscribe'), " "), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.buttonContainer
  }, /*#__PURE__*/_react.default.createElement(_link.default, {
    className: _style.default.keepSubscriptionButton,
    href: moocUrl
  }, translate('keep_subscription'))), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.buttonContainer
  }, /*#__PURE__*/_react.default.createElement("button", {
    type: "button",
    className: _style.default.unsubscribeButton,
    onClick: onUnsubscribeButtonClick
  }, translate('unsubscribe')))) : null, hasUnsubscribed ? /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.unsubscribeConfirmation
  }, translate('premium_unsubscribe_confirmation')) : null);
};
Unsubscribe.contextTypes = {
  translate: _provider.default.childContextTypes.translate
};
Unsubscribe.propTypes = process.env.NODE_ENV !== "production" ? {
  moocUrl: _propTypes.default.string,
  hasUnsubscribed: _propTypes.default.bool,
  onUnsubscribeButtonClick: _propTypes.default.func
} : {};
var _default = exports.default = Unsubscribe;
//# sourceMappingURL=index.js.map