{"size": 741, "ext": "js", "max_stars_repo_path": "src/Thread/PostBody.js", "max_stars_repo_name": "viyomam/viyomamtalk", "max_stars_repo_stars_event_min_datetime": "2016-03-08T15:39:38.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-19T21:57:39.000Z", "max_issues_repo_path": "src/Thread/PostBody.js", "max_issues_repo_name": "Super-Smile/best-forum", "max_issues_repo_issues_event_min_datetime": "2016-03-26T10:39:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-04-06T05:24:44.000Z", "max_forks_repo_path": "src/Thread/PostBody.js", "max_forks_repo_name": "Super-Smile/best-forum", "max_forks_repo_forks_event_min_datetime": "2016-03-27T11:45:40.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-29T10:32:43.000Z"}
{"max_stars_count": 266, "max_issues_count": 31, "max_forks_count": 83, "avg_line_length": 17.6428571429, "max_line_length": 42, "alphanum_fraction": 0.5033738192}
import React from 'react'
import { styles } from 'refire-app'
import ReactMarkdown from 'react-markdown'
import CodeBlock from '../App/CodeBlock'

const PostBody = ({
      post,
      hide,
      styles,
    }) => {

  if (hide || !post) {
    return ( <div></div> )
  } else {
    return (
      <div
        className={styles.bodyContainer}>
        <ReactMarkdown
          className={styles.markdown}
          escapeHtml={true}
          source={post.body}
          renderers={
            {
              ...ReactMarkdown.renderers,
              ...{ CodeBlock },
            }
          }
        />
      </div>
    )
  }
}

const css = {
  bodyContainer: {
    margin: "0 0 10px 0",
  },

}

export default styles(css, PostBody)
