import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import FirstPageIcon from '@material-ui/icons/FirstPage'; import KeyboardArrowLeft from '@material-ui/icons/KeyboardArrowLeft'; import KeyboardArrowRight from '@material-ui/icons/KeyboardArrowRight'; import LastPageIcon from '@material-ui/icons/LastPage'; import { IconButton } from '@material-ui/core'; const actionsStyles = theme => ({ root: { flexShrink: 0, color: theme.palette.text.secondary, marginLeft: theme.spacing(2.5), }, }); class TbPaginationActions extends React.Component { handleFirstPageButtonClick = event => { this.props.onChangePage(event, 0); }; handleBackButtonClick = event => { this.props.onChangePage(event, this.props.page - 1); }; handleNextButtonClick = event => { this.props.onChangePage(event, this.props.page + 1); }; handleLastPageButtonClick = event => { this.props.onChangePage( event, Math.max(0, Math.ceil(this.props.count / this.props.rowsPerPage) - 1), ); }; render() { const { classes, count, page, rowsPerPage, theme } = this.props; return (