// Components import { Stack, Typography } from "@mui/material"; import Breadcrumbs from "../../../Components/Breadcrumbs"; import MonitorStatusHeader from "../../../Components/MonitorStatusHeader"; import MonitorTimeFrameHeader from "../../../Components/MonitorTimeFrameHeader"; import StatusBoxes from "./Components/StatusBoxes"; import GaugeBoxes from "./Components/GaugeBoxes"; import AreaChartBoxes from "./Components/AreaChartBoxes"; import GenericFallback from "../../../Components/GenericFallback"; // Utils import { useTheme } from "@emotion/react"; import { useIsAdmin } from "../../../Hooks/useIsAdmin"; import { useFetchHardwareMonitorById } from "../../../Hooks/monitorHooks"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { useParams } from "react-router-dom"; // Constants const BREADCRUMBS = [ { name: "infrastructure monitors", path: "/infrastructure" }, { name: "details", path: "" }, ]; const InfrastructureDetails = () => { // Redux state // Local state const [dateRange, setDateRange] = useState("recent"); // Utils const theme = useTheme(); const { monitorId } = useParams(); const { t } = useTranslation(); const isAdmin = useIsAdmin(); const [monitor, isLoading, networkError] = useFetchHardwareMonitorById({ monitorId, dateRange, }); if (networkError === true) { return ( {t("common.toasts.networkError")} {t("common.toasts.checkConnection")} ); } if (!isLoading && monitor?.stats?.checks?.length === 0) { return ( {t("distributedUptimeDetailsNoMonitorHistory")} ); } return ( ); }; export default InfrastructureDetails;