Refactor incidents

This commit is contained in:
Alex Holliday committed 2025-01-29 15:06:41 -08:00
1 parent c1144a4432
commit 02d93fdcd4
14 files changed
+383 -513

No files matched your search

@@ -9,7 +9,7 @@ import BarChart from "../../../../../Components/Charts/BarChart";
import ActionsMenu from "../ActionsMenu";
import LoadingSpinner from "../LoadingSpinner";
import UptimeDataTableSkeleton from "./skeleton";
import TableSkeleton from "../../../../../Components/Table/skeleton";
// Utils
import { useTheme } from "@emotion/react";
@@ -175,7 +175,7 @@ const UptimeDataTable = ({
];
if (monitorsAreLoading) {
return <UptimeDataTableSkeleton />;
return <TableSkeleton />;
}
return (
@@ -1,14 +0,0 @@
import { Skeleton } from "@mui/material";
const UptimeDataTableSkeleton = () => {
return (
<Skeleton
variant="rounded"
width="100%"
height="100%"
flex={1}
/>
);
};
export default UptimeDataTableSkeleton;
+17 -4
View File
@@ -6,13 +6,13 @@ import UptimeDataTable from "./Components/UptimeDataTable";
import Pagination from "../../../Components/Table/TablePagination";
import CreateMonitorHeader from "../../../Components/CreateMonitorHeader";
import Fallback from "../../../Components/Fallback";
import NetworkErrorFallback from "../../../Components/NetworkErrorFallback";
import GenericFallback from "../../../Components/GenericFallback";
import SearchComponent from "./Components/SearchComponent";
import MonitorCountHeader from "../../../Components/MonitorCountHeader";
// MUI Components
import { Stack, Box, Button } from "@mui/material";
import { Stack, Box, Button, Typography } from "@mui/material";
// Utils
import { useState, useCallback } from "react";
@@ -109,8 +109,21 @@ const UptimeMonitors = () => {
});
const totalMonitors = monitorsSummary?.totalMonitors ?? 0;
if (networkError) return <NetworkErrorFallback />;
if (networkError) {
return (
<GenericFallback>
{" "}
<Typography
variant="h1"
marginY={theme.spacing(4)}
color={theme.palette.primary.contrastTextTertiary}
>
Network error
</Typography>
<Typography>Please check your connection</Typography>
</GenericFallback>
);
}
if (!isLoading && !monitorsAreLoading && totalMonitors === 0) {
return (
<Fallback