{"size": 871, "ext": "js", "max_stars_repo_path": "components/Post/PostHeader.js", "max_stars_repo_name": "comerc/yobrNXT", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "components/Post/PostHeader.js", "max_issues_repo_name": "comerc/yobrNXT", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "components/Post/PostHeader.js", "max_forks_repo_name": "comerc/yobrNXT", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.3939393939, "max_line_length": 81, "alphanum_fraction": 0.6877152698}
import React, { PropTypes } from 'react'
import { formatDateTime } from 'app/utils'
import PostTitle from './PostTitle'
import PostHubs from './PostHubs'

// TODO кнопка редактирования только для собственных статей

const PostHeader = ({ isTeaser, published, flow, id, title, hubs, isDraft }) => (
  <div>
    <span className="published">{formatDateTime(published)}</span>
    <PostTitle {...{ isTeaser, flow, id, title, isDraft }} />
    <PostHubs {...{ hubs }} />
  </div>
)

PostHeader.propTypes = {
  isTeaser: PropTypes.bool,
  published: PropTypes.string,
  flow: PropTypes.shape({
    id: PropTypes.string,
    name: PropTypes.string,
  }),
  id: PropTypes.number,
  title: PropTypes.string,
  hubs: PropTypes.arrayOf(PropTypes.shape({
    id: PropTypes.string,
    name: PropTypes.string,
  })).isRequired,
  isDraft: PropTypes.bool,
}

export default PostHeader
