diff --git a/client/src/Components/monitors/GeoChecksMap.tsx b/client/src/Components/monitors/GeoChecksMap.tsx index 7ee1a1b4a..09d5bb15d 100644 --- a/client/src/Components/monitors/GeoChecksMap.tsx +++ b/client/src/Components/monitors/GeoChecksMap.tsx @@ -1,5 +1,5 @@ import { useRef, useEffect, useState } from "react"; -import { Box, Typography, Stack, useTheme } from "@mui/material"; +import { Box, Typography, Stack, useTheme, GlobalStyles } from "@mui/material"; import Map, { Marker, Popup } from "react-map-gl/maplibre"; import type { MapRef } from "react-map-gl/maplibre"; import type { FlatGeoCheck } from "@/Types/GeoCheck"; @@ -15,6 +15,21 @@ export const GeoChecksMap = ({ geoChecks }: GeoChecksMapProps) => { const theme = useTheme(); const isDarkMode = theme.palette.mode === "dark"; + const mapPopupStyles = ( + + ); + useEffect(() => { if (geoChecks.length === 0 || !mapRef.current) return; @@ -55,103 +70,119 @@ export const GeoChecksMap = ({ geoChecks }: GeoChecksMapProps) => { }; return ( -
- + {mapPopupStyles} + - {geoChecks.map((check, index) => ( - { - e.originalEvent.stopPropagation(); - setSelectedCheck(check); - }} - > -
+ {geoChecks.map((check, index) => ( + { + e.originalEvent.stopPropagation(); + setSelectedCheck(check); }} - /> - - ))} + > +
+ + ))} - {selectedCheck && ( - setSelectedCheck(null)} - closeOnClick={false} - > - - setSelectedCheck(null)} + closeOnClick={false} + > + - {selectedCheck.location.city}, {selectedCheck.location.country} - - - - - Status: - {" "} - {selectedCheck.status ? "Up" : "Down"} - - - - Status Code: - {" "} - {selectedCheck.statusCode} - - - - Response Time: - {" "} - {formatResponseTime(selectedCheck.timings.total)} - - {new Date(selectedCheck.createdAt).toLocaleString()} + {selectedCheck.location.city}, {selectedCheck.location.country} - - - - )} - -
+ + + + Status: + {" "} + {selectedCheck.status ? "Up" : "Down"} + + + + Status Code: + {" "} + {selectedCheck.statusCode} + + + + Response Time: + {" "} + {formatResponseTime(selectedCheck.timings.total)} + + + {new Date(selectedCheck.createdAt).toLocaleString()} + + + + + )} + + + ); }; diff --git a/client/src/Types/env.d.ts b/client/src/Types/env.d.ts index cd714db75..c269d0f63 100644 --- a/client/src/Types/env.d.ts +++ b/client/src/Types/env.d.ts @@ -17,3 +17,8 @@ declare module "*.svg?react" { >; export default ReactComponent; } + +declare module "*.css" { + const content: string; + export default content; +}