function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Cta from '../../atom/cta';
import Link from '../../atom/link';
import style from './style.css';
const News = (props, context) => {
  const {
    image,
    title,
    date,
    description,
    authorLogo,
    cta
  } = props;
  return /*#__PURE__*/React.createElement("div", {
    className: style.news
  }, /*#__PURE__*/React.createElement("div", {
    className: style.image
  }, cta ? /*#__PURE__*/React.createElement(Link, {
    href: cta.href,
    className: style.linkImage,
    target: cta.target,
    "data-name": "news-image"
  }, /*#__PURE__*/React.createElement("img", {
    src: image
  })) : /*#__PURE__*/React.createElement("img", {
    src: image
  })), /*#__PURE__*/React.createElement("div", {
    className: style.infos
  }, /*#__PURE__*/React.createElement(Link, {
    href: cta && cta.href,
    title: title,
    className: classnames(style.title, style.innerHTML),
    target: cta && cta.target,
    "data-name": "news-title",
    dangerouslySetInnerHTML: {
      __html: title
    }
  }), /*#__PURE__*/React.createElement("div", {
    className: style.date
  }, date), /*#__PURE__*/React.createElement("div", {
    className: style.description
  }, /*#__PURE__*/React.createElement("div", {
    // eslint-disable-next-line react/no-danger
    dangerouslySetInnerHTML: {
      __html: description
    }
  })), /*#__PURE__*/React.createElement("div", {
    className: style.bottom
  }, /*#__PURE__*/React.createElement("div", {
    className: style.author
  }, /*#__PURE__*/React.createElement("img", {
    src: authorLogo
  })), cta ? /*#__PURE__*/React.createElement(Cta, _extends({}, cta, {
    secondary: true,
    name: "news-cta"
  })) : null)), cta ? /*#__PURE__*/React.createElement(Link, {
    className: style.link,
    href: cta.href,
    target: cta.target
  }) : null);
};
News.propTypes = process.env.NODE_ENV !== "production" ? {
  image: PropTypes.string,
  title: PropTypes.string,
  date: PropTypes.string,
  description: PropTypes.string,
  authorLogo: PropTypes.string,
  cta: PropTypes.shape(Cta.propTypes)
} : {};
export default News;
//# sourceMappingURL=index.js.map