import FirstPageIcon from '@mui/icons-material/FirstPage'; import KeyboardArrowLeft from '@mui/icons-material/KeyboardArrowLeft'; import KeyboardArrowRight from '@mui/icons-material/KeyboardArrowRight'; import LastPageIcon from '@mui/icons-material/LastPage'; import IconButton from '@mui/material/IconButton'; type TablePaginationActionsProps = { count: number; onPageChange: ( event: React.MouseEvent | null, page: number ) => void; page: number; rowsPerPage: number; }; import { useTranslation } from 'react-i18next'; import { labelFirstPage, labelLastPage, labelNextPage, labelPreviousPage } from '../translatedLabels'; const PaginationActions = ({ onPageChange, page, rowsPerPage, count }: TablePaginationActionsProps): JSX.Element => { const { t } = useTranslation(); const changeToFirstPage = ( event: React.MouseEvent ): void => { onPageChange(event, 0); }; const changeToPreviousPage = ( event: React.MouseEvent ): void => { onPageChange(event, page - 1); }; const changeToNextPage = ( event: React.MouseEvent ): void => { onPageChange(event, page + 1); }; const lastPage = Math.ceil(count / rowsPerPage) - 1; const isFirstPage = page === 0; const isLastPage = page >= lastPage; const changeToLastPage = ( event: React.MouseEvent ): void => { onPageChange(event, Math.max(0, lastPage)); }; return (
); }; export default PaginationActions;