fix: latest incident panel: Box -> Grid

This commit is contained in:
mannilakash committed 2026-01-29 13:21:56 -05:00
1 parent 66efa25e2b
commit a154ad11b5
1 file changed
+38 -29
@@ -6,6 +6,7 @@ import { getHumanReadableDuration } from "@/Utils/timeUtilsLegacy.js";
import Icon from "@/Components/v1/Icon"; import Icon from "@/Components/v1/Icon";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import useGetIncidentsDuration from "../../hooks/useGetIncidentsDuration"; import useGetIncidentsDuration from "../../hooks/useGetIncidentsDuration";
import { Grid } from "@mui/material";
const IncidentItem = ({ incident }) => { const IncidentItem = ({ incident }) => {
const { t } = useTranslation(); const { t } = useTranslation();
@@ -28,30 +29,24 @@ const IncidentItem = ({ incident }) => {
}; };
return ( return (
<Box <Grid
container
alignItems="center"
spacing={2}
sx={{ sx={{
display: {
xs: "flex",
lg: "grid",
},
alignItems: "center",
flexWrap: {
xs: "wrap",
lg: "nowrap",
},
gap: theme.spacing(2),
width: "100%", width: "100%",
py: theme.spacing(0.5), py: theme.spacing(0.5),
gridTemplateColumns: {
lg: "1fr 100px 80px",
},
}} }}
> >
<Stack <Grid
direction="row" item
alignItems="center" xs={12}
gap={theme.spacing(2)} lg={5}
sx={{
display: "flex",
alignItems: "center",
gap: theme.spacing(2),
}}
> >
<Box sx={iconWrapperStyle}> <Box sx={iconWrapperStyle}>
<Icon <Icon
@@ -66,9 +61,18 @@ const IncidentItem = ({ incident }) => {
> >
{incident.monitorName || t("incidentsPage.unknownMonitor")} {incident.monitorName || t("incidentsPage.unknownMonitor")}
</Typography> </Typography>
</Stack> </Grid>
<Box sx={{ display: "flex", justifyContent: "center" }}> <Grid
item
xs={12}
md={6}
lg={3}
sx={{
display: "flex",
justifyContent: { xs: "flex-start", md: "center" },
}}
>
<StatusLabel <StatusLabel
status={isActive ? "down" : "up"} status={isActive ? "down" : "up"}
text={isActive ? t("incidentsPage.active") : t("incidentsPage.resolved")} text={isActive ? t("incidentsPage.active") : t("incidentsPage.resolved")}
@@ -76,16 +80,21 @@ const IncidentItem = ({ incident }) => {
textTransform: "capitalize", textTransform: "capitalize",
}} }}
/> />
</Box> </Grid>
<Typography <Grid
variant="body1" item
fontWeight={500} xs={12}
textAlign="right" md={6}
lg={4}
sx={{
textAlign: { xs: "left", md: "right" },
fontWeight: 500,
}}
> >
{duration} <Typography variant="body1">{duration}</Typography>
</Typography> </Grid>
</Box> </Grid>
); );
}; };