import Stack from "@mui/material/Stack"; import { StatusHeader } from "@/components/status-pages/StatusHeader"; import { StatusPageRow } from "@/components/status-pages/StatusPageRow"; import { BasePage } from "@/components/design-elements"; import { useTheme } from "@mui/material/styles"; import type { IMonitor } from "@/types/monitor"; import { useGet } from "@/hooks/UseApi"; import type { ApiResponse } from "@/types/api"; import { useParams } from "react-router"; import type { IStatusPageWithMonitors } from "@/types/status-page"; import { NameHeader } from "@/components/status-pages/NameHeader"; import { config } from "@/config/index"; const GLOBAL_REFRESH = config.GLOBAL_REFRESH; const StatusPages = () => { const theme = useTheme(); const { id } = useParams(); const { response } = useGet>( `/status-pages/${id}`, {}, { refreshInterval: GLOBAL_REFRESH, keepPreviousData: true } ); const statusPage = response?.data; const monitors: IMonitor[] = statusPage?.monitors || []; if (!statusPage) { return null; } return ( {monitors?.map((monitor: IMonitor) => { return ; })} ); }; export default StatusPages;