| Total Complexity | 1 |
| Complexity/F | 0 |
| Lines of Code | 24 |
| 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 TableCell from '@material-ui/core/TableCell' |
||
| 4 | import TableRow from '@material-ui/core/TableRow' |
||
| 5 | import { DEFAULT_LINE_HEIGHT } from 'core/const/posts' |
||
| 6 | |||
| 7 | 5 | const EmptyRows = ({ page, rowsPerPage, postsLength }) => { |
|
| 8 | const emptyRows = |
||
| 9 | 2 | rowsPerPage - Math.min(rowsPerPage, postsLength - page * rowsPerPage) |
|
| 10 | 2 | return emptyRows ? ( |
|
| 11 | <TableRow style={{ height: DEFAULT_LINE_HEIGHT * emptyRows }}> |
||
| 12 | <TableCell colSpan={6} /> |
||
| 13 | </TableRow> |
||
| 14 | ) : null |
||
| 15 | } |
||
| 16 | |||
| 17 | export default EmptyRows |
||
| 18 | |||
| 19 | 5 | EmptyRows.propTypes = { |
|
| 20 | page: PropTypes.number, |
||
| 21 | rowsPerPage: PropTypes.number, |
||
| 22 | postsLength: PropTypes.number |
||
| 23 | } |
||
| 24 |