diff --git a/client/src/Components/v2/design-elements/StatusLabel.tsx b/client/src/Components/v2/design-elements/StatusLabel.tsx index c9991f0d4..d7212ddff 100644 --- a/client/src/Components/v2/design-elements/StatusLabel.tsx +++ b/client/src/Components/v2/design-elements/StatusLabel.tsx @@ -98,7 +98,7 @@ export const ValueLabel = ({ value, text }: { value: ValueType; text: string }) borderRadius="50%" marginRight="5px" /> - {transformedText} + {transformedText} ); }; diff --git a/client/src/Pages/Incidents/Components/CardDetails.tsx b/client/src/Pages/Incidents/Components/CardDetails.tsx index e564b39fe..c2b2f4140 100644 --- a/client/src/Pages/Incidents/Components/CardDetails.tsx +++ b/client/src/Pages/Incidents/Components/CardDetails.tsx @@ -1,6 +1,5 @@ import Stack from "@mui/material/Stack"; import Grid from "@mui/material/Grid"; -import Box from "@mui/material/Box"; import Divider from "@mui/material/Divider"; import Typography from "@mui/material/Typography"; import { BaseBox, ValueLabel } from "@/Components/v2/design-elements"; @@ -9,6 +8,10 @@ import { useTranslation } from "react-i18next"; import type { Incident } from "@/Types/Incident"; import type { Monitor } from "@/Types/Monitor"; import { useTheme } from "@mui/material"; +import { useSelector } from "react-redux"; +import type { RootState } from "@/Types/state"; +import { formatDateWithTz } from "@/Utils/TimeUtils"; +import { getIncidentsDuration } from "@/Pages/Incidents/utils"; interface CardDetailsProps { incident: Incident | null; @@ -19,8 +22,7 @@ interface CardDetailsProps { export const CardDetails = ({ incident, monitor, sx }: CardDetailsProps) => { const { t } = useTranslation(); const theme = useTheme(); - - void monitor; // Will be used in future UI implementation + const uiTimezone = useSelector((state: RootState) => state.ui.timezone); if (!incident) { return null; @@ -42,22 +44,83 @@ export const CardDetails = ({ incident, monitor, sx }: CardDetailsProps) => { - - - - + {t("pages.incidents.dialog.details.status")} + + + + {monitor && ( + <> + {t("pages.incidents.dialog.details.monitor")} + + {monitor.name ?? "N/A"} + + + {t("pages.incidents.dialog.details.url")} + + + {monitor.url ?? "N/A"} + + + )} + + + + + + {t("pages.incidents.dialog.details.analysis")} + + + + {t("pages.incidents.dialog.details.timeline")} + + + {t("pages.incidents.dialog.details.detailsLabel")} + + + + + + + + + {t("pages.incidents.dialog.details.startedAt")} + + + + {formatDateWithTz(incident.startTime, "D MMM YYYY, h:mm A", uiTimezone)} + + + + {t("pages.incidents.dialog.details.statusCode")} + + + {incident.statusCode ?? "N/A"} + + + {t("pages.incidents.dialog.details.downtime")} + + + {getIncidentsDuration(incident)} + + + {t("pages.incidents.dialog.details.message")} + + + {incident.message ?? "N/A"} - Test - Test diff --git a/client/src/Pages/Incidents/Components/DialogIncidentDetails.tsx b/client/src/Pages/Incidents/Components/DialogIncidentDetails.tsx index fdab8d969..da24538e2 100644 --- a/client/src/Pages/Incidents/Components/DialogIncidentDetails.tsx +++ b/client/src/Pages/Incidents/Components/DialogIncidentDetails.tsx @@ -29,7 +29,7 @@ export const DialogIncidentDetails = ({ onConfirm={onResolve} cancelText={t("common.buttons.cancel")} confirmText={t("pages.incidents.dialog.details.resolve")} - maxWidth="md" + maxWidth="sm" fullWidth >