"use strict";

exports.__esModule = true;
exports.default = void 0;
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _novaIcons = require("@coorpacademy/nova-icons");
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
var _provider = _interopRequireDefault(require("../../atom/provider"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const BrandDownloadBox = (props, context) => {
  const {
    title = '',
    warning = '',
    description = '',
    href = '',
    onClick,
    submitValue = ''
  } = props;
  const {
    skin
  } = context;
  const negativeColor = (0, _get2.default)('common.negative', skin);
  const type = warning ? /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.texts
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaSolidInterfaceFeedbackInterfaceAlertCircle, {
    className: _style.default.icon,
    style: {
      color: negativeColor
    }
  }), /*#__PURE__*/_react.default.createElement("span", {
    className: _style.default.warning
  }, warning), /*#__PURE__*/_react.default.createElement("p", {
    className: _style.default.description
  }, description)) : /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.titleTexts
  }, /*#__PURE__*/_react.default.createElement("span", {
    className: _style.default.title
  }, title), /*#__PURE__*/_react.default.createElement("p", {
    className: _style.default.description
  }, description));
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.wrapper
  }, type, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
    className: _style.default.button,
    link: {
      href,
      download: true
    },
    onClick: onClick,
    label: submitValue,
    customStyle: {
      backgroundColor: '#FFA000',
      color: 'white'
    }
  }));
};
BrandDownloadBox.contextTypes = {
  skin: _provider.default.childContextTypes.skin
};
BrandDownloadBox.propTypes = process.env.NODE_ENV !== "production" ? {
  title: _propTypes.default.string,
  warning: _propTypes.default.string,
  description: _propTypes.default.string,
  href: _propTypes.default.string,
  onClick: _propTypes.default.func,
  submitValue: _propTypes.default.string
} : {};
var _default = exports.default = BrandDownloadBox;
//# sourceMappingURL=index.js.map