From b8a5af9c10f183d84b3efc8550f5f01806f117de Mon Sep 17 00:00:00 2001 From: karenvicent Date: Wed, 21 Jan 2026 16:12:42 -0500 Subject: [PATCH] delete detail incident page --- .../src/Pages/v1/Incidents2/Details/index.jsx | 171 ------------------ 1 file changed, 171 deletions(-) delete mode 100644 client/src/Pages/v1/Incidents2/Details/index.jsx diff --git a/client/src/Pages/v1/Incidents2/Details/index.jsx b/client/src/Pages/v1/Incidents2/Details/index.jsx deleted file mode 100644 index 67388899d..000000000 --- a/client/src/Pages/v1/Incidents2/Details/index.jsx +++ /dev/null @@ -1,171 +0,0 @@ -// Components -import { Stack, Typography, Grid, Box } from "@mui/material"; -import Breadcrumbs from "@/Components/v1/Breadcrumbs/index.jsx"; -import GenericFallback from "@/Components/v1/GenericFallback/index.jsx"; -import SummaryCard from "../Components/SummaryCard"; -import useGetIncidentsDuration from "../hooks/useGetIncidentsDuration"; - -// Utils -import { useParams } from "react-router-dom"; -import { useTheme } from "@emotion/react"; -import { useTranslation } from "react-i18next"; -import useFetchIncidents from "../hooks/useFetchIncidents"; -import { useEffect, useState } from "react"; - -// Constants -const BREADCRUMBS = [ - { name: "incidents", path: "/incidents" }, - { name: "details", path: "" }, -]; - -const IncidentDetails = () => { - const theme = useTheme(); - const { t } = useTranslation(); - const { incidentId } = useParams(); - const { fetchIncidentById } = useFetchIncidents(); - const [incident, setIncident] = useState(null); - const [isLoading, setIsLoading] = useState(true); - const isActive = incident?.status === true; - const duration = useGetIncidentsDuration(incident || null, isActive); - useEffect(() => { - const loadIncident = async () => { - if (incidentId) { - setIsLoading(true); - try { - const incidentData = await fetchIncidentById(incidentId); - console.log(incidentData); - setIncident(incidentData); - } catch (error) { - console.error("Error fetching incident:", error); - } finally { - setIsLoading(false); - } - } - }; - - loadIncident(); - }, [incidentId, fetchIncidentById]); - - if (isLoading) { - return ( - - - - - ); - } - - if (!incident) { - return ( - - - - - ); - } - - return ( - - - - {t("incidentsPage.incidentDetails", "Incident Details")} - - - - - - {duration} - - - - - {incident?.startTime} - - - {!isActive && ( - - - {incident?.endTime} - - - )} - - - - - {incident?.statusCode} - {incident?.message} - - - - - {incident?.checks.length} - - - {!isActive && ( - - - {incident?.resolutionType} - {incident?.resolutionType === "manual" && ( - - - Resolved by {incident?.resolvedBy?.email} - - {incident?.comment && ( - Comment: {incident?.comment} - )} - - )} - - - )} - - - - ); -}; - -export default IncidentDetails;