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