@@ -209,6 +209,7 @@ function DataTableToolbar<T extends Record<string, unknown>>({
209209 * @property {React.ReactElement } toolbarComponents - the components to display in the toolbar
210210 * @property {MenuItem[] } menuItems - the menu items
211211 * @property {boolean } disableCheckbox - boolean to disable the checkbox
212+ * @property {boolean } hideFooter - boolean to hide the footer
212213 */
213214export interface DataTableProps < T extends Record < string , unknown > > {
214215 /** The title of the table */
@@ -231,6 +232,8 @@ export interface DataTableProps<T extends Record<string, unknown>> {
231232 menuItems ?: MenuItem [ ] ;
232233 /** Boolean to disable the checkbox */
233234 disableCheckbox ?: boolean ;
235+ /** Whether to hide the footer */
236+ hideFooter ?: boolean ;
234237}
235238
236239/**
@@ -249,6 +252,7 @@ export function DataTable<T extends Record<string, unknown>>({
249252 toolbarComponents,
250253 menuItems,
251254 disableCheckbox = false ,
255+ hideFooter = false ,
252256} : DataTableProps < T > ) {
253257 const theme = useTheme ( ) ;
254258 const isMobile = useMediaQuery ( theme . breakpoints . down ( "sm" ) ) ;
@@ -602,19 +606,22 @@ export function DataTable<T extends Record<string, unknown>>({
602606 ) ;
603607 } }
604608 />
605- < TablePagination
606- component = "div"
607- rowsPerPageOptions = { [ 25 , 50 , 100 , 500 , 1000 ] }
608- count = { totalRows }
609- showFirstButton
610- showLastButton
611- rowsPerPage = { table . getState ( ) . pagination . pageSize }
612- page = { table . getState ( ) . pagination . pageIndex }
613- onPageChange = { handleChangePage }
614- onRowsPerPageChange = { handleChangeRowsPerPage }
615- labelRowsPerPage = { isMobile ? "" : "Rows per page" }
616- sx = { { flexShrink : 0 } }
617- />
609+ { ! hideFooter && (
610+ < TablePagination
611+ component = "div"
612+ rowsPerPageOptions = { [ 25 , 50 , 100 , 500 , 1000 ] }
613+ count = { totalRows }
614+ showFirstButton
615+ showLastButton
616+ rowsPerPage = { table . getState ( ) . pagination . pageSize }
617+ page = { table . getState ( ) . pagination . pageIndex }
618+ onPageChange = { handleChangePage }
619+ onRowsPerPageChange = { handleChangeRowsPerPage }
620+ labelRowsPerPage = { isMobile ? "" : "Rows per page" }
621+ sx = { { flexShrink : 0 } }
622+ data-testid = "data-table-pagination"
623+ />
624+ ) }
618625 </ Paper >
619626 { menuItems && (
620627 < Menu
0 commit comments