"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 _button = _interopRequireDefault(require("../../atom/button"));
var _link = _interopRequireDefault(require("../../atom/link"));
var _provider = _interopRequireDefault(require("../../atom/provider"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const CookieBanner = ({
  href,
  onClick
}, context) => {
  const {
    translate,
    skin
  } = context;
  const primary = (0, _get2.default)('common.primary', skin);
  const intro = translate('cookies_title');
  const text = translate('cookies_details');
  const title = translate('cookies_policy');
  const ok = translate('Ok');
  const handleOnClick = onClick;
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.banner
  }, /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement("span", {
    className: _style.default.intro
  }, intro), /*#__PURE__*/_react.default.createElement("span", null, text), /*#__PURE__*/_react.default.createElement(_link.default, {
    className: _style.default.link,
    href: href,
    target: "_blank",
    style: {
      color: primary
    }
  }, title)), /*#__PURE__*/_react.default.createElement(_button.default, {
    type: "link",
    "data-name": "cookie-banner-cta",
    className: _style.default.button,
    submitValue: ok,
    onClick: handleOnClick,
    style: {
      backgroundColor: primary
    }
  }));
};
CookieBanner.contextTypes = {
  skin: _provider.default.childContextTypes.skin,
  translate: _provider.default.childContextTypes.translate
};
CookieBanner.propTypes = process.env.NODE_ENV !== "production" ? {
  href: _propTypes.default.string,
  onClick: _propTypes.default.func
} : {};
var _default = exports.default = CookieBanner;
//# sourceMappingURL=index.js.map