| Total Complexity | 0 |
| Complexity/F | 0 |
| Lines of Code | 43 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | import React from 'react' |
||
| 2 | import PropTypes from 'prop-types' |
||
| 3 | import TableContainer from '@material-ui/core/TableContainer' |
||
| 4 | import Container from 'core/components/Container' |
||
| 5 | import Head from 'posts/containers/Head' |
||
| 6 | import Pagination from 'posts/containers/Pagination' |
||
| 7 | import Body from 'posts/containers/Body' |
||
| 8 | import SelectedToolbar from 'posts/containers/SelectedToolbar' |
||
| 9 | import Paper from 'posts/components/Posts/Paper' |
||
| 10 | import Table from 'posts/components/Posts/Table' |
||
| 11 | |||
| 12 | 3 | const Posts = ({ posts, selectedPosts }) => { |
|
| 13 | 1 | const numSelected = selectedPosts.length |
|
| 14 | 1 | const rowCount = posts.length |
|
| 15 | 1 | return ( |
|
| 16 | <Container> |
||
| 17 | <Paper> |
||
| 18 | <SelectedToolbar numSelected={numSelected} /> |
||
| 19 | <TableContainer> |
||
| 20 | <Table |
||
| 21 | aria-labelledby="tableTitle" |
||
| 22 | size={'medium'} |
||
| 23 | aria-label="enhanced table" |
||
| 24 | style={{ marginBottom: '15px', overflow: 'auto' }} |
||
| 25 | > |
||
| 26 | <Head numSelected={numSelected} rowCount={rowCount} /> |
||
| 27 | <Body posts={posts} selectedPosts={selectedPosts} /> |
||
| 28 | </Table> |
||
| 29 | </TableContainer> |
||
| 30 | <Pagination postCount={rowCount} /> |
||
| 31 | </Paper> |
||
| 32 | </Container> |
||
| 33 | ) |
||
| 34 | } |
||
| 35 | |||
| 36 | export default Posts |
||
| 37 | |||
| 38 | 3 | Posts.propTypes = { |
|
| 39 | posts: PropTypes.array, |
||
| 40 | selectedPosts: PropTypes.array, |
||
| 41 | fetchPostSummary: PropTypes.func |
||
| 42 | } |
||
| 43 |