Skip to content

Enhancement show total items #221

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added PropTypes to ItemCounter component.
wrigh393 committed Jul 13, 2021
commit fcd41b93efe329f82da36dc245b151b83df6def2
17 changes: 16 additions & 1 deletion src/components/ItemCounter/ItemCounter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { makeStyles, Typography, useTheme } from '@material-ui/core'
import React from 'react'
import PropTypes from "prop-types";

export default function ItemCounter({ filteredItems, totalItems }) {
const theme = useTheme();
@@ -10,6 +11,20 @@ export default function ItemCounter({ filteredItems, totalItems }) {
});
const classes = useStyles();
return (
<Typography classes={{ root: classes.margin }}>{`Showing ${filteredItems} out of ${totalItems}`}</Typography>
<Typography classes={{ root: classes.margin }}>
{`Showing ${filteredItems} out of ${totalItems}`}
</Typography>
)
}

ItemCounter.propTypes = {
/** The number of filtered items in the table. */
"filteredItems": PropTypes.number.isRequired,
/** The total number of items in the table */
"totalitems": PropTypes.number.isRequired
};

ItemCounter.defaultProps = {
"filteredItems": 0,
"totalItems": 0,
};