diff --git a/client/src/Pages/Infrastructure/Details/Components/Gauges.tsx b/client/src/Pages/Infrastructure/Details/Components/Gauges.tsx index e2b053aef..2e9e88a0f 100644 --- a/client/src/Pages/Infrastructure/Details/Components/Gauges.tsx +++ b/client/src/Pages/Infrastructure/Details/Components/Gauges.tsx @@ -8,6 +8,9 @@ import { useTheme } from "@mui/material"; import useMediaQuery from "@mui/material/useMediaQuery"; import type { CheckSnapshot } from "@/Types/Check"; +// Width each gauge card aims for, and the basis the wrapping row breaks on. +const GAUGE_MAX_WIDTH = 260; + export const InfraDetailsGauges = ({ snapshot, }: { @@ -26,10 +29,19 @@ export const InfraDetailsGauges = ({ direction={isSmall ? "column" : "row"} spacing={theme.spacing(8)} alignItems={"stretch"} + flexWrap={"wrap"} + useFlexGap + sx={{ + // The gauge cards are flex: 1 1 0, so a wrapping row would never + // overflow and they would squash to min-content instead of breaking + // the line. Give each one its own width as the basis so the row wraps + // at the intended card size. + "& > *": { flexBasis: GAUGE_MAX_WIDTH }, + }} >