gap
This commit is contained in:
1 parent
a8d83b33b4
commit
4a79013ef2
2 files changed
+10
-1
No files matched your search
@@ -1,22 +1,30 @@
|
|||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
|
// Using strip + square; icons removed
|
||||||
import { useTheme } from "@mui/material/styles";
|
import { useTheme } from "@mui/material/styles";
|
||||||
import type { ICheck } from "@/types/check";
|
import type { ICheck } from "@/types/check";
|
||||||
import { getResponseColor } from "@/utils/DataUtils";
|
import { getResponseColor } from "@/utils/DataUtils";
|
||||||
import { HeatmapResponseTimeTooltip } from "./HeatmapResponseTimeTooltip";
|
import { HeatmapResponseTimeTooltip } from "./HeatmapResponseTimeTooltip";
|
||||||
import type { SxProps } from "@mui/material/styles";
|
import type { SxProps } from "@mui/material/styles";
|
||||||
|
import type { ResponsiveStyleValue } from "@mui/system";
|
||||||
interface HeatmapResponseTimeProps {
|
interface HeatmapResponseTimeProps {
|
||||||
checks: ICheck[];
|
checks: ICheck[];
|
||||||
|
gap?: ResponsiveStyleValue<number | string>;
|
||||||
availabilityCellSx?: SxProps;
|
availabilityCellSx?: SxProps;
|
||||||
responseCellSx?: SxProps;
|
responseCellSx?: SxProps;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const HeatmapResponseTime = ({
|
export const HeatmapResponseTime = ({
|
||||||
checks,
|
checks,
|
||||||
|
gap,
|
||||||
availabilityCellSx,
|
availabilityCellSx,
|
||||||
responseCellSx,
|
responseCellSx,
|
||||||
}: HeatmapResponseTimeProps) => {
|
}: HeatmapResponseTimeProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
|
if (!gap) {
|
||||||
|
gap = theme.spacing(0.5);
|
||||||
|
}
|
||||||
|
|
||||||
if (!checks || checks.length === 0) return null;
|
if (!checks || checks.length === 0) return null;
|
||||||
let data = Array<any>();
|
let data = Array<any>();
|
||||||
|
|
||||||
@@ -38,7 +46,7 @@ export const HeatmapResponseTime = ({
|
|||||||
width: "100%",
|
width: "100%",
|
||||||
display: "grid",
|
display: "grid",
|
||||||
gridTemplateColumns: "repeat(25, 1fr)",
|
gridTemplateColumns: "repeat(25, 1fr)",
|
||||||
gap: theme.spacing(0.5),
|
gap: gap,
|
||||||
alignItems: "stretch",
|
alignItems: "stretch",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export const StatusPageRow = ({ monitor }: { monitor: IMonitor }) => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid size={12} marginTop={theme.spacing(2)}>
|
<Grid size={12} marginTop={theme.spacing(2)}>
|
||||||
<HeatmapResponseTime
|
<HeatmapResponseTime
|
||||||
|
gap={{ xs: theme.spacing(0.5), md: theme.spacing(2) }}
|
||||||
checks={monitor?.latestChecks}
|
checks={monitor?.latestChecks}
|
||||||
availabilityCellSx={{
|
availabilityCellSx={{
|
||||||
borderRadius: {
|
borderRadius: {
|
||||||
|
|||||||
Reference in new issue
Block a user