Passed
Push — master ( 9a73f0...7331d4 )
by Huu-Phat
01:50 queued 11s
created

cms/src/posts/components/Posts.js

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 43
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 0
eloc 38
mnd 0
bc 0
fnc 0
dl 0
loc 43
ccs 5
cts 5
cp 1
bpm 0
cpm 0
noi 0
c 0
b 0
f 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