import React from 'react';
import cx from 'classnames';
import StringHash from 'string-hash';
import { LinkTo } from '../LinkTo';
import { BackgroundImage } from '../../utils';

var ArticleFeatureCard = function ArticleFeatureCard(_ref) {
  var category = _ref.category,
      publishDate = _ref.publishDate,
      title = _ref.title,
      url = _ref.url,
      image = _ref.image;
  var hash = image && StringHash(image);
  var imageClasses = cx('img', "rbiHandler-" + hash);
  return /*#__PURE__*/React.createElement("div", {
    className: "slide"
  }, /*#__PURE__*/React.createElement("div", {
    className: "inner"
  }, /*#__PURE__*/React.createElement(LinkTo, {
    type: "route",
    url: url
  }, BackgroundImage(image, hash), /*#__PURE__*/React.createElement("div", {
    className: imageClasses
  }), /*#__PURE__*/React.createElement("div", {
    className: "content"
  }, /*#__PURE__*/React.createElement("h2", {
    className: "title"
  }, /*#__PURE__*/React.createElement("span", null, title)), /*#__PURE__*/React.createElement("div", {
    className: "category"
  }, category), /*#__PURE__*/React.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;
export { ArticleFeatureCardWrapper as ArticleFeatureCard };