This commit is contained in:
Alex Holliday committed 2025-11-25 23:37:56 +00:00
1 parent b5bdd73a90
commit 33aab936fe
5 files changed
+60 -34

No files matched your search

@@ -7,7 +7,7 @@ import { HeatmapResponseTimeTooltip } from "./HeatmapResponseTimeTooltip";
interface HistogramResponseTimeProps {
checks: ICheck[];
height?: number | string;
height?: ResponsiveStyleValue<number | string>;
gap?: ResponsiveStyleValue<number | string>;
}
@@ -1,13 +1,16 @@
import Grid from "@mui/material/Grid";
import Typography from "@mui/material/Typography";
import { HeatmapResponseTime } from "../common/HeatmapResponseTime";
import { HistogramResponseTime } from "../common/HistogramResponseTime";
import { StatusLabel } from "@/components/design-elements";
import { useTheme } from "@mui/material/styles";
import { useTheme } from "@mui/material/styles";
import { useAppSelector } from "@/hooks/AppHooks";
import type { IMonitor } from "@/types/monitor";
export const StatusPageRow = ({ monitor }: { monitor: IMonitor }) => {
const theme = useTheme();
const type = useAppSelector((state) => state?.ui?.chartType || "heatmap");
return (
<Grid container>
@@ -23,22 +26,31 @@ export const StatusPageRow = ({ monitor }: { monitor: IMonitor }) => {
<StatusLabel status={monitor?.status} sx={{ py: 1 }} />
</Grid>
<Grid size={12} marginTop={theme.spacing(2)}>
<HeatmapResponseTime
gap={{ xs: theme.spacing(0.5), md: theme.spacing(2) }}
checks={monitor?.latestChecks}
availabilityCellSx={{
borderRadius: {
xs: theme.spacing(0.5),
md: theme.shape.borderRadius,
},
}}
responseCellSx={{
borderRadius: {
xs: theme.spacing(0.5),
md: theme.shape.borderRadius,
},
}}
/>
{type === "heatmap" && (
<HeatmapResponseTime
gap={{ xs: theme.spacing(0.5), md: theme.spacing(2) }}
checks={monitor?.latestChecks}
availabilityCellSx={{
borderRadius: {
xs: theme.spacing(0.5),
md: theme.shape.borderRadius,
},
}}
responseCellSx={{
borderRadius: {
xs: theme.spacing(0.5),
md: theme.shape.borderRadius,
},
}}
/>
)}
{type === "histogram" && (
<HistogramResponseTime
checks={monitor?.latestChecks}
height={{ xs: 50, md: 100 }}
gap={{ xs: 0.5, md: theme.spacing(4) }}
/>
)}
</Grid>
</Grid>
);