2
0

Utils.tsx 584 B

12345678910111213141516171819
  1. import { Typography } from '@material-ui/core';
  2. import { useTranslation } from 'react-i18next';
  3. export const getLabelDisplayedRows =
  4. (info: string) =>
  5. ({ from = 0, to = 0, count = 0 }) => {
  6. const { t: commonTrans } = useTranslation();
  7. const gridTrans = commonTrans('grid');
  8. return (
  9. <>
  10. <Typography variant="body2" component="span">
  11. {from} - {to}
  12. </Typography>
  13. <Typography variant="body2" className="rows" component="span">
  14. {gridTrans.of} {count} {gridTrans.results} {info}
  15. </Typography>
  16. </>
  17. );
  18. };