diff --git a/client/src/components/design-elements/Table.tsx b/client/src/components/design-elements/Table.tsx index 4dff95fe2..bcd438635 100644 --- a/client/src/components/design-elements/Table.tsx +++ b/client/src/components/design-elements/Table.tsx @@ -346,7 +346,6 @@ function HasMoreTablePaginationActions( ) { const theme = useTheme(); const { hasMore, page, onPageChange } = props; - console.log(JSON.stringify(props, null, 2)); const handleFirstPageButtonClick = ( event: React.MouseEvent @@ -420,7 +419,7 @@ interface PaginationProps extends TablePaginationProps { } export const Pagination = ({ ...props }: PaginationProps) => { - const hasMore = props.hasMore; + const { hasMore, ...rest } = props; const isSmall = useMediaQuery((theme: any) => theme.breakpoints.down("sm")); const theme = useTheme(); const labelDisplayedRows = ({ @@ -440,12 +439,16 @@ export const Pagination = ({ ...props }: PaginationProps) => { return ( + typeof hasMore === "boolean" ? ( + + ) : ( + + ) } rowsPerPageOptions={[5, 10, 25]} labelDisplayedRows={labelDisplayedRows} - {...props} + {...rest} sx={{ "& .MuiTablePagination-toolbar": isSmall ? { diff --git a/client/src/pages/checks/ChecksPage.tsx b/client/src/pages/checks/ChecksPage.tsx index a34a6739a..5c931fcca 100644 --- a/client/src/pages/checks/ChecksPage.tsx +++ b/client/src/pages/checks/ChecksPage.tsx @@ -7,7 +7,7 @@ import { ChecksTable } from "@/pages/checks/ChecksTable"; import { LoadingSpinner } from "@/components/design-elements"; import { useTheme } from "@mui/material/styles"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import type { SelectChangeEvent } from "@mui/material/Select"; import { useGet } from "@/hooks/UseApi"; import type { ApiResponse } from "@/types/api"; @@ -46,6 +46,10 @@ const ChecksPage = () => { const checks = checksResponse?.data?.checks || []; const hasMore = checksResponse?.data?.hasMore; + useEffect(() => { + setPage(0); + }, [range, status, selectedMonitorId]); + return (