components.table.page.PageStats.js Maven / Gradle / Ivy
import { Box, Divider, Typography } from '@mui/material';
import { useTranslator } from 'hooks/translator';
const PageStats = ({data, pageable}) => {
const { t } = useTranslator()
const {rows, page, count} = data
if (pageable) {
const entriesStr = `${(page.pageNum * page.pageSize) + 1}..${(page.pageNum * page.pageSize) + rows.length}`
const pageStat = t('table.stat', {variables: { entries: entriesStr, cnt: count}})
const pageStatStr = count == 0 || !count ? entriesStr : pageStat
return (
{pageStatStr}
)
}
else return null
}
export default PageStats