"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames = _interopRequireDefault(require("classnames"));
var _cta = _interopRequireDefault(require("../../atom/cta"));
var _link = _interopRequireDefault(require("../../atom/link"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
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); }
const News = (props, context) => {
  const {
    image,
    title,
    date,
    description,
    authorLogo,
    cta
  } = props;
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.news
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.image
  }, cta ? /*#__PURE__*/_react.default.createElement(_link.default, {
    href: cta.href,
    className: _style.default.linkImage,
    target: cta.target,
    "data-name": "news-image"
  }, /*#__PURE__*/_react.default.createElement("img", {
    src: image
  })) : /*#__PURE__*/_react.default.createElement("img", {
    src: image
  })), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.infos
  }, /*#__PURE__*/_react.default.createElement(_link.default, {
    href: cta && cta.href,
    title: title,
    className: (0, _classnames.default)(_style.default.title, _style.default.innerHTML),
    target: cta && cta.target,
    "data-name": "news-title",
    dangerouslySetInnerHTML: {
      __html: title
    }
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.date
  }, date), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.description
  }, /*#__PURE__*/_react.default.createElement("div", {
    // eslint-disable-next-line react/no-danger
    dangerouslySetInnerHTML: {
      __html: description
    }
  })), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.bottom
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.author
  }, /*#__PURE__*/_react.default.createElement("img", {
    src: authorLogo
  })), cta ? /*#__PURE__*/_react.default.createElement(_cta.default, _extends({}, cta, {
    secondary: true,
    name: "news-cta"
  })) : null)), cta ? /*#__PURE__*/_react.default.createElement(_link.default, {
    className: _style.default.link,
    href: cta.href,
    target: cta.target
  }) : null);
};
News.propTypes = process.env.NODE_ENV !== "production" ? {
  image: _propTypes.default.string,
  title: _propTypes.default.string,
  date: _propTypes.default.string,
  description: _propTypes.default.string,
  authorLogo: _propTypes.default.string,
  cta: _propTypes.default.shape(_cta.default.propTypes)
} : {};
var _default = exports.default = News;
//# sourceMappingURL=index.js.map