"use strict";

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

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var _Button = _interopRequireDefault(require("../Button"));

var _Wrapper = _interopRequireDefault(require("../Wrapper"));

var _js = require("../../globals/js");

var _excluded = ["title", "subTitle", "image", "children", "className"];

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

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var prefix = _js.settings.prefix;

var HeroExternal = function HeroExternal(_ref) {
  var title = _ref.title,
      subTitle = _ref.subTitle,
      image = _ref.image,
      children = _ref.children,
      className = _ref.className,
      other = _objectWithoutProperties(_ref, _excluded);

  var wrapperClasses = classNames("".concat(prefix, "--hero-ext"), _defineProperty({}, "".concat(className), className));
  return (
    /*#__PURE__*/
    // TODO: Provide a prop to set the backgrond image (linear-gradient should be not editable)
    // TODO: Provide a prop [string] to set the backgrond position (optional).
    _react.default.createElement("div", {
      className: wrapperClasses // TODO: do we need a token for the linear gradient?
      ,
      style: {
        backgroundImage: "linear-gradient(rgba(26, 66, 98, 0.8), rgba(26, 66, 98, 0.8)), url(".concat(image, ")"),
        backgroundPosition: 'center right'
      }
    }, /*#__PURE__*/_react.default.createElement(_Wrapper.default, {
      pageWidth: "md"
    }, /*#__PURE__*/_react.default.createElement("div", {
      className: "".concat(prefix, "--hero-ext__content")
    }, title && /*#__PURE__*/_react.default.createElement("h1", {
      className: "".concat(prefix, "--hero-ext__heading")
    }, title), subTitle && /*#__PURE__*/_react.default.createElement("p", {
      className: "".concat(prefix, "--hero-ext__body-copy")
    }, subTitle)), children))
  );
};

HeroExternal.propTypes = {
  title: _propTypes.default.node,
  subTitle: _propTypes.default.node,
  image: _propTypes.default.string,
  children: _propTypes.default.node,
  className: _propTypes.default.string
};
var _default = HeroExternal;
exports.default = _default;