"use strict";

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

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

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

var _Share = require("../Share");

var _DragonKitContext = require("../../context/DragonKitContext");

var _Categories = require("../Categories");

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

// TODO: fix share link
var Article = function Article(_ref) {
  var categories = _ref.categories,
      publishDate = _ref.publishDate,
      title = _ref.title,
      children = _ref.children;

  var _useDragonKitValue = (0, _DragonKitContext.useDragonKitValue)(),
      dragonKit = _useDragonKitValue[0];

  return /*#__PURE__*/_react.default.createElement("article", {
    className: "blog-article"
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: "inner"
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: "blog-article-sidebar"
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: "back"
  }, /*#__PURE__*/_react.default.createElement(_LinkTo.LinkTo, {
    type: "route",
    to: dragonKit.blogUrl
  }, "Back")), /*#__PURE__*/_react.default.createElement(_Share.Share, null)), /*#__PURE__*/_react.default.createElement("div", {
    className: "blog-article-date"
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: "category"
  }, categories[0]), /*#__PURE__*/_react.default.createElement("time", {
    dateTime: publishDate
  }, publishDate)), /*#__PURE__*/_react.default.createElement("div", {
    className: "article-body"
  }, /*#__PURE__*/_react.default.createElement("h1", null, title), children), /*#__PURE__*/_react.default.createElement("div", {
    className: "blog-article-share"
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: "inner"
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: "title"
  }, "Share"), /*#__PURE__*/_react.default.createElement(_Share.Share, null))), /*#__PURE__*/_react.default.createElement("div", {
    className: "blog-article-categories"
  }, /*#__PURE__*/_react.default.createElement(_Categories.Categories, {
    title: "Filed Under",
    categories: categories,
    isArticle: true
  }))));
};

Article.displayName = 'Article';
var ArticleDoc;

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

var ArticleWrapper = ArticleDoc || Article;
exports.Article = ArticleWrapper;