From 30b135eba33ae7df555dbffecc09ea458fb12cf4 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Thu, 28 Aug 2025 12:21:34 -0700 Subject: [PATCH] add tooltip to incident table --- .../Components/IncidentTable/index.jsx | 73 ++++++++++++++++++- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/client/src/Pages/Incidents/Components/IncidentTable/index.jsx b/client/src/Pages/Incidents/Components/IncidentTable/index.jsx index e8929d9ed..df9174290 100644 --- a/client/src/Pages/Incidents/Components/IncidentTable/index.jsx +++ b/client/src/Pages/Incidents/Components/IncidentTable/index.jsx @@ -1,5 +1,10 @@ //Components -import Table from "../../../../Components/Table"; +import Stack from "@mui/material/Stack"; +import DataTable from "../../../../Components/Table"; +import Table from "@mui/material/Table"; +import TableBody from "@mui/material/TableBody"; +import TableRow from "@mui/material/TableRow"; +import TableCell from "@mui/material/TableCell"; import TableSkeleton from "../../../../Components/Table/skeleton"; import Pagination from "../../../../Components/Table/TablePagination"; import { StatusLabel } from "../../../../Components/Label"; @@ -16,7 +21,68 @@ import { useTranslation } from "react-i18next"; import { useFetchChecksTeam } from "../../../../Hooks/checkHooks"; import { useFetchChecksByMonitor } from "../../../../Hooks/checkHooks"; import { useResolveIncident } from "../../../../Hooks/checkHooks"; -import { Button, Typography } from "@mui/material"; +import { Button, Typography, useTheme } from "@mui/material"; +import { lighten } from "@mui/material/styles"; + +const GetTooltip = (row) => { + const theme = useTheme(); + const phases = row?.timings?.phases; + + const phaseKeyFormattingMap = { + firstByte: "first byte", + }; + return ( + + {`Status code: ${row?.statusCode}`} + {`Response time: ${row?.responseTime} ms`} + {phases && ( + <> + {`Request timing: `} + + + {Object.keys(phases)?.map((phaseKey) => ( + + + + {`${phaseKeyFormattingMap[phaseKey] || phaseKey}:`} + + + + {`${phases[phaseKey]} ms`} + + + ))} + +
+ + )} +
+ ); +}; const IncidentTable = ({ isLoading, @@ -167,9 +233,10 @@ const IncidentTable = ({ return ( <> -