import React from 'react';
import { LinkTo } from '../LinkTo';
import { Share } from '../Share';
import { useDragonKitValue } from '../../context/DragonKitContext';
import { Categories } from '../Categories'; // TODO: fix share link

var Article = function Article(_ref) {
  var categories = _ref.categories,
      publishDate = _ref.publishDate,
      title = _ref.title,
      children = _ref.children;

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

  return /*#__PURE__*/React.createElement("article", {
    className: "blog-article"
  }, /*#__PURE__*/React.createElement("div", {
    className: "inner"
  }, /*#__PURE__*/React.createElement("div", {
    className: "blog-article-sidebar"
  }, /*#__PURE__*/React.createElement("div", {
    className: "back"
  }, /*#__PURE__*/React.createElement(LinkTo, {
    type: "route",
    to: dragonKit.blogUrl
  }, "Back")), /*#__PURE__*/React.createElement(Share, null)), /*#__PURE__*/React.createElement("div", {
    className: "blog-article-date"
  }, /*#__PURE__*/React.createElement("div", {
    className: "category"
  }, categories[0]), /*#__PURE__*/React.createElement("time", {
    dateTime: publishDate
  }, publishDate)), /*#__PURE__*/React.createElement("div", {
    className: "article-body"
  }, /*#__PURE__*/React.createElement("h1", null, title), children), /*#__PURE__*/React.createElement("div", {
    className: "blog-article-share"
  }, /*#__PURE__*/React.createElement("div", {
    className: "inner"
  }, /*#__PURE__*/React.createElement("div", {
    className: "title"
  }, "Share"), /*#__PURE__*/React.createElement(Share, null))), /*#__PURE__*/React.createElement("div", {
    className: "blog-article-categories"
  }, /*#__PURE__*/React.createElement(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;
export { ArticleWrapper as Article };