"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

require("./style.sass");

var _context = require("../../context");

var _blogBanner = _interopRequireDefault(require("../../assets/images/blog-banner.png"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var Banner = function Banner(props) {
  return /*#__PURE__*/_react["default"].createElement(_context.MainContext.Consumer, null, function (value) {
    var colors = value !== null && value !== void 0 && value.colors && typeof (value === null || value === void 0 ? void 0 : value.colors) === 'string' ? JSON.parse(value.colors) : value.colors;
    var headerBackground = colors && colors['header-background'];
    var headerColor = colors && colors['header-color'];
    var style = !value.coverImage && headerBackground ? null : {
      backgroundImage: "url(".concat(value.coverImage || _blogBanner["default"], ")")
    };
    return /*#__PURE__*/_react["default"].createElement("section", {
      className: "wizrd-home-banner ".concat(headerColor === '#FFFFFF' ? 'white-text' : 'black-text'),
      style: style
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "container"
    }, /*#__PURE__*/_react["default"].createElement("div", {
      className: "wizrd-banner-content"
    }, props.children)));
  });
};

var _default = Banner;
exports["default"] = _default;