/* eslint-disable no-unused-vars */ import IconButton from "@mui/material/IconButton"; import Tooltip from "@mui/material/Tooltip"; import Hidden from "@mui/material/Hidden"; import Button from "@mui/material/Button"; import PropTypes from "prop-types"; import { withStyles } from "@mui/styles"; import * as React from "react"; /* eslint-enable no-unused-vars */ class MTablePaginationInner extends React.Component { handleFirstPageButtonClick = (event) => { this.props.onPageChange(event, 0); }; handleBackButtonClick = (event) => { this.props.onPageChange(event, this.props.page - 1); }; handleNextButtonClick = (event) => { this.props.onPageChange(event, this.props.page + 1); }; handleNumberButtonClick = (number) => (event) => { this.props.onPageChange(event, number); }; handleLastPageButtonClick = (event) => { this.props.onPageChange( event, Math.max(0, Math.ceil(this.props.count / this.props.rowsPerPage) - 1) ); }; renderPagesButton(start, end) { const buttons = []; for (let p = start; p <= end; p++) { const buttonVariant = p === this.props.page ? "contained" : "text"; buttons.push( ); } return {buttons}; } render() { const { classes, count, page, rowsPerPage, theme, showFirstLastPageButtons, } = this.props; const localization = { ...MTablePaginationInner.defaultProps.localization, ...this.props.localization, }; const maxPages = Math.ceil(count / rowsPerPage) - 1; const pageStart = Math.max(page - 1, 0); const pageEnd = Math.min(maxPages, page + 1); return (