Refactor Pagination component to accept a label to improve reusability. Use Pagination component with Incident table

This commit is contained in:
Alex Holliday committed 2025-01-21 15:31:40 -08:00
1 parent 4ed995692d
commit 9535ffa192
8 files changed
+49 -89

No files matched your search

+10 -10
View File
@@ -108,16 +108,16 @@ const CreateMonitor = () => {
}
if (monitor.type === "http") {
const checkEndpointAction = await dispatch(
checkEndpointResolution({ authToken, monitorURL: form.url })
);
if (checkEndpointAction.meta.requestStatus === "rejected") {
createToast({
body: "The endpoint you entered doesn't resolve. Check the URL again.",
});
setErrors({ url: "The entered URL is not reachable." });
return;
}
// const checkEndpointAction = await dispatch(
// checkEndpointResolution({ authToken, monitorURL: form.url })
// );
// if (checkEndpointAction.meta.requestStatus === "rejected") {
// createToast({
// body: "The endpoint you entered doesn't resolve. Check the URL again.",
// });
// setErrors({ url: "The entered URL is not reachable." });
// return;
// }
}
form = {
+3 -2
View File
@@ -5,7 +5,7 @@ import SkeletonLayout from "./skeleton";
import Fallback from "./fallback";
import StatusBox from "./StatusBox";
import UptimeDataTable from "./UptimeDataTable";
import { Pagination } from "../../../Components/Table/TablePagination";
import Pagination from "../../../Components/Table/TablePagination";
// Utils
import { useTheme } from "@emotion/react";
@@ -225,7 +225,8 @@ const UptimeMonitors = () => {
triggerUpdate={triggerUpdate}
/>
<Pagination
monitorCount={totalMonitors}
itemCount={totalMonitors}
paginationLabel="monitors"
page={page}
rowsPerPage={rowsPerPage}
handleChangePage={handleChangePage}