"use strict";

exports.__esModule = true;
exports.default = void 0;
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
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 DisciplineCTA = (props, context) => {
  const {
    skin
  } = context;
  const {
    startLabel,
    buyLabel,
    start,
    buy
  } = props;
  const startLearning = /*#__PURE__*/_react.default.createElement("span", {
    // eslint-disable-next-line react/no-danger
    dangerouslySetInnerHTML: {
      __html: startLabel
    }
  });
  const premium = /*#__PURE__*/_react.default.createElement("span", {
    // eslint-disable-next-line react/no-danger
    dangerouslySetInnerHTML: {
      __html: buyLabel
    }
  });
  const startColor = (0, _getOr2.default)('#f0f', 'common.primary', skin);
  const startButton = start ? /*#__PURE__*/_react.default.createElement("a", {
    "data-name": "start",
    className: _style.default.start,
    onClick: start,
    style: {
      backgroundColor: startColor
    }
  }, startLearning) : null;
  const buyButton = buy ? /*#__PURE__*/_react.default.createElement("a", {
    "data-name": "buy",
    className: _style.default.buy,
    onClick: buy
  }, premium) : null;
  return /*#__PURE__*/_react.default.createElement("div", {
    "data-name": "disciplineCta",
    className: _style.default.head
  }, startButton, buyButton);
};
DisciplineCTA.contextTypes = {
  skin: _provider.default.childContextTypes.skin
};
DisciplineCTA.propTypes = process.env.NODE_ENV !== "production" ? {
  startLabel: _propTypes.default.string,
  buyLabel: _propTypes.default.string,
  start: _propTypes.default.func,
  buy: _propTypes.default.func
} : {};
var _default = exports.default = DisciplineCTA;
//# sourceMappingURL=index.js.map