<commit_before>import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createSelector } from 'reselect'
import { bindActionCreators } from 'redux'
import { actions } from 'ducks/posts'
import Post from './Post'

class PostPage extends React.Component {
  componentDidMount() {
    const { read, id } = this.props
    read({ id })
  }
  render() {
    const { post } = this.props
    return <Post {...post} />
  }
}

PostPage.propTypes = {
  id: PropTypes.number,
  post: PropTypes.object,
  read: PropTypes.func,
}

const getId = (state, props) =>
  parseInt(props.match.params.id, 10)

const getPosts = (state) =>
  state.posts

const post = createSelector(
  [getPosts, getId],
  (posts, id) =>
    posts.find(element =>
      element.id === id)
)

const mapStateToProps = (state, props) => ({
  id: getId(state, props),
  post: post(state, props),
})<commit_msg>Добавить Page в PostPage<commit_after>import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { createSelector } from 'reselect'
import { bindActionCreators } from 'redux'
import { actions } from 'ducks/posts'
import Post from './Post'
import Page, { Header, Footer } from 'components/Page'
import Helmet from 'react-helmet'

class PostPage extends React.Component {
  componentDidMount() {
    const { read, id } = this.props
    read({ id })
  }
  render() {
    const { post } = this.props
    return (
      <Page>
        <Helmet
          defaultTitle="Yobr"
        />
        <Header>Header</Header>
        <Post {...post} />
        <Footer>Footer</Footer>
      </Page>
    )
  }
}

PostPage.propTypes = {
  id: PropTypes.number,
  post: PropTypes.object,
  read: PropTypes.func,
}

const getId = (state, props) =>
  parseInt(props.match.params.id, 10)

const getPosts = (state) =>
  state.posts

const post = createSelector(
  [getPosts, getId],
  (posts, id) =>
    posts.find(element =>
      element.id === id)
)

const mapStateToProps = (state, props) => ({
  id: getId(state, props),
  post: post(state, props),
})
{'fraction_non_alphanumeric': 0.14625850340136054, 'fraction_numerical': 0.001943634596695821, 'mean_word_length': 3.176470588235294, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5372867', 'n_tokens_mistral': 694, 'n_tokens_neox': 694, 'n_words': 179}