Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 41 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 100% |
Changes | 0 |
1 | import React from 'react' |
||
2 | import PropTypes from 'prop-types' |
||
3 | import Row from 'react-bootstrap/Row' |
||
4 | import Container from '~/modules/post/components/post/Container' |
||
5 | import Header from '~/modules/post/components/post/Header' |
||
6 | import PostInfo from '~/modules/post/components/post/PostInfo' |
||
7 | import Content from '~/modules/post/components/post/Content' |
||
8 | |||
9 | 1 | const Post = ({ data }) => ( |
|
10 | 1 | <Container> |
|
11 | <article> |
||
12 | <Row> |
||
13 | <Header>{data.header}</Header> |
||
14 | </Row> |
||
15 | <PostInfo |
||
16 | authorName={data.authorName} |
||
17 | avatar={'/images/blogs/default-avatar.png'} |
||
18 | date={data.date} |
||
19 | minRead={data.minRead} |
||
20 | /> |
||
21 | <Content> |
||
22 | <div dangerouslySetInnerHTML={createMarkup(data.content)} /> |
||
23 | </Content> |
||
24 | </article> |
||
25 | </Container> |
||
26 | ) |
||
27 | function createMarkup(content) { |
||
28 | 1 | return { __html: content } |
|
29 | } |
||
30 | |||
31 | 1 | Post.propTypes = { |
|
32 | data: PropTypes.shape({ |
||
33 | header: PropTypes.string, |
||
34 | authorName: PropTypes.string, |
||
35 | date: PropTypes.string, |
||
36 | minRead: PropTypes.string, |
||
37 | content: PropTypes.string |
||
38 | }) |
||
39 | } |
||
40 | export default Post |
||
41 |