Files
Checkmate/client/src/Components/monitors/HeaderMonitorsSummary.tsx
T

35 lines
918 B
TypeScript
Raw Normal View History

2026-02-11 20:11:22 +00:00
import {
UpStatusBox,
DownStatusBox,
PausedStatusBox,
InitializingStatusBox,
2026-02-14 22:57:27 +00:00
BreachedStatusBox,
2026-02-20 18:13:39 +00:00
} from "@/Components/design-elements";
2026-02-11 20:11:22 +00:00
import Stack from "@mui/material/Stack";
import type { MonitorsSummary } from "@/Types/Monitor";
import { useTheme } from "@mui/material";
interface MonitorsSummaryProps {
summary: MonitorsSummary | null;
2026-02-14 23:09:27 +00:00
showBreached?: boolean;
2026-02-11 20:11:22 +00:00
}
2026-02-14 23:09:27 +00:00
export const HeaderMonitorsSummary = ({
summary,
showBreached = false,
}: MonitorsSummaryProps) => {
2026-02-11 20:11:22 +00:00
const theme = useTheme();
return (
<Stack
direction={{ xs: "column", md: "row" }}
gap={theme.spacing(8)}
>
<UpStatusBox n={summary?.upMonitors || 0} />
<DownStatusBox n={summary?.downMonitors || 0} />
2026-02-14 23:09:27 +00:00
{showBreached && <BreachedStatusBox n={summary?.breachedMonitors || 0} />}
2026-02-11 20:11:22 +00:00
<PausedStatusBox n={summary?.pausedMonitors || 0} />
<InitializingStatusBox n={summary?.initializingMonitors || 0} />
</Stack>
);
};