import PropTypes from "prop-types"; import { Box, Button } from "@mui/material"; import LeftArrowDouble from "../../../../assets/icons/left-arrow-double.svg?react"; import RightArrowDouble from "../../../../assets/icons/right-arrow-double.svg?react"; import LeftArrow from "../../../../assets/icons/left-arrow.svg?react"; import RightArrow from "../../../../assets/icons/right-arrow.svg?react"; TablePaginationActions.propTypes = { count: PropTypes.number.isRequired, page: PropTypes.number.isRequired, rowsPerPage: PropTypes.number.isRequired, onPageChange: PropTypes.func.isRequired, }; /** * Component for pagination actions (first, previous, next, last). * * @component * @param {Object} props * @param {number} props.count - Total number of items. * @param {number} props.page - Current page number. * @param {number} props.rowsPerPage - Number of rows per page. * @param {function} props.onPageChange - Callback function to handle page change. * * @returns {JSX.Element} Pagination actions component. */ function TablePaginationActions({ count, page, rowsPerPage, onPageChange }) { const handleFirstPageButtonClick = (event) => { onPageChange(event, 0); }; const handleBackButtonClick = (event) => { onPageChange(event, page - 1); }; const handleNextButtonClick = (event) => { onPageChange(event, page + 1); }; const handleLastPageButtonClick = (event) => { onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1)); }; return ( ); } export { TablePaginationActions };