"use strict";

exports.__esModule = true;
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _flex = _interopRequireDefault(require("../../../components/templates/flex"));
var _icon = require("../../../components/icon");
var _typography = require("../../../components/typography");
var _image = _interopRequireDefault(require("./image"));
var _anchor = _interopRequireDefault(require("./anchor"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var Item = function Item(_ref) {
  var item = _ref.item;
  var publishedAt = item.last_publication_date,
    data = item.data;
  var title = data.title,
    description = data.description,
    url = data.url,
    image = data.image,
    label = data.label;
  var imageSrc = image && image.url;
  var dateFormated = new Date(publishedAt);
  return /*#__PURE__*/_react["default"].createElement(_flex["default"], {
    column: true,
    gap: 2
  }, /*#__PURE__*/_react["default"].createElement(_flex["default"], {
    gap: 4
  }, imageSrc && /*#__PURE__*/_react["default"].createElement(_image["default"], {
    src: imageSrc,
    width: "160px"
  }), /*#__PURE__*/_react["default"].createElement(_flex["default"], {
    column: true,
    gap: 2
  }, /*#__PURE__*/_react["default"].createElement(_typography.Text, {
    strong: true
  }, title), /*#__PURE__*/_react["default"].createElement(_typography.Text, null, description))), /*#__PURE__*/_react["default"].createElement(_flex["default"], {
    justifyContent: "between",
    alignItems: "center"
  }, /*#__PURE__*/_react["default"].createElement(_typography.TextSmall, null, dateFormated.toLocaleDateString()), /*#__PURE__*/_react["default"].createElement(_anchor["default"], {
    href: url,
    target: "_blank",
    rel: "noopener noreferrer",
    gap: 1,
    alignItems: "center"
  }, /*#__PURE__*/_react["default"].createElement(_typography.Text, {
    color: "success",
    strong: true
  }, label), /*#__PURE__*/_react["default"].createElement(_icon.Icon, {
    color: "success",
    rotate: 2,
    name: "arrow_left"
  }))));
};
var _default = exports["default"] = Item;