import React from 'react';
import PropTypes from 'prop-types';
import Provider from '../../atom/provider';
import Link from '../../atom/link';
import style from './style.css';
const Unsubscribe = (props, context) => {
  const {
    translate
  } = context;
  const {
    moocUrl,
    hasUnsubscribed,
    onUnsubscribeButtonClick
  } = props;
  return /*#__PURE__*/React.createElement("div", null, !hasUnsubscribed ? /*#__PURE__*/React.createElement("div", {
    className: style.unsubscribe
  }, /*#__PURE__*/React.createElement("div", {
    className: style.description
  }, translate('confirm_unsubscribe'), " "), /*#__PURE__*/React.createElement("div", {
    className: style.buttonContainer
  }, /*#__PURE__*/React.createElement(Link, {
    className: style.keepSubscriptionButton,
    href: moocUrl
  }, translate('keep_subscription'))), /*#__PURE__*/React.createElement("div", {
    className: style.buttonContainer
  }, /*#__PURE__*/React.createElement("button", {
    type: "button",
    className: style.unsubscribeButton,
    onClick: onUnsubscribeButtonClick
  }, translate('unsubscribe')))) : null, hasUnsubscribed ? /*#__PURE__*/React.createElement("div", {
    className: style.unsubscribeConfirmation
  }, translate('premium_unsubscribe_confirmation')) : null);
};
Unsubscribe.contextTypes = {
  translate: Provider.childContextTypes.translate
};
Unsubscribe.propTypes = process.env.NODE_ENV !== "production" ? {
  moocUrl: PropTypes.string,
  hasUnsubscribed: PropTypes.bool,
  onUnsubscribeButtonClick: PropTypes.func
} : {};
export default Unsubscribe;
//# sourceMappingURL=index.js.map