"use strict";

exports.__esModule = true;
exports.ArticleFeatureCard = void 0;

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

var _classnames = _interopRequireDefault(require("classnames"));

var _stringHash = _interopRequireDefault(require("string-hash"));

var _LinkTo = require("../LinkTo");

var _utils = require("../../utils");

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

var ArticleFeatureCard = function ArticleFeatureCard(_ref) {
  var category = _ref.category,
      publishDate = _ref.publishDate,
      title = _ref.title,
      url = _ref.url,
      image = _ref.image;
  var hash = image && (0, _stringHash.default)(image);
  var imageClasses = (0, _classnames.default)('img', "rbiHandler-" + hash);
  return /*#__PURE__*/_react.default.createElement("div", {
    className: "slide"
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: "inner"
  }, /*#__PURE__*/_react.default.createElement(_LinkTo.LinkTo, {
    type: "route",
    url: url
  }, (0, _utils.BackgroundImage)(image, hash), /*#__PURE__*/_react.default.createElement("div", {
    className: imageClasses
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: "content"
  }, /*#__PURE__*/_react.default.createElement("h2", {
    className: "title"
  }, /*#__PURE__*/_react.default.createElement("span", null, title)), /*#__PURE__*/_react.default.createElement("div", {
    className: "category"
  }, category), /*#__PURE__*/_react.default.createElement("time", {
    dateTime: publishDate
  }, publishDate)))));
};

ArticleFeatureCard.displayName = 'ArticleFeatureCard';
var ArticleFeatureCardDoc;

if (process.env.NODE_ENV !== 'production') {
  // eslint-disable-next-line global-require
  ArticleFeatureCardDoc = require('./doc').doc(ArticleFeatureCard);
}

var ArticleFeatureCardWrapper = ArticleFeatureCardDoc || ArticleFeatureCard;
exports.ArticleFeatureCard = ArticleFeatureCardWrapper;