import { Box, Typography } from '@mui/material'

const TableStats = ({
  limit,
  totalCount,
  page,
}: {
  limit: number
  page: number
  totalCount: number
}) => {
  const pageStart = (page - 1) * limit + 1
  const pageEnd = page * limit <= totalCount ? page * limit : totalCount

  return (
    <Box>
      <Typography variant="subtitle1">{`${pageStart} - ${pageEnd} of ${totalCount}`}</Typography>
    </Box>
  )
}

export default TableStats
