components.table.TablePaginator.js Maven / Gradle / Ivy
import {
TablePagination,
} from '@mui/material';
import PropTypes from 'prop-types';
import Settings from 'helpers/settings';
const TablePaginator = ({count, page, setPage, pageSize, setPageSize}) => {
const handleLimitChange = (event) => {
const newPageSize = event.target.value
setPageSize(newPageSize);
setPage(Math.floor((page * pageSize) / newPageSize))
const settings = new Settings()
settings.setPageSize(newPageSize)
};
const handlePageChange = (event, newPage) => {
setPage(newPage);
};
return (
) ;
}
TablePaginator.propTypes = {
count : PropTypes.number.isRequired,
page : PropTypes.number.isRequired,
pageSize : PropTypes.number.isRequired,
setPage : PropTypes.func.isRequired,
setPageSize: PropTypes.func.isRequired
};
export default TablePaginator;