import { Stack, Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; import PulseDot from "../../../../../Components/Animated/PulseDot"; import "flag-icons/css/flag-icons.min.css"; import { ColContainer } from "../../../../../Components/StandardContainer"; const BASE_BOX_PADDING_VERTICAL = 16; const BASE_BOX_PADDING_HORIZONTAL = 8; const DeviceTicker = ({ data, width = "100%", connectionStatus }) => { const theme = useTheme(); const statusColor = { up: theme.palette.success.main, down: theme.palette.error.main, }; return ( {connectionStatus === "up" ? "Connected" : "No connection"} {data.map((dataPoint) => { const countryCode = dataPoint?.countryCode?.toLowerCase() ?? null; const flag = countryCode ? `fi fi-${countryCode}` : null; const city = dataPoint?.city !== "" ? dataPoint?.city : "Unknown"; return ( ); })}
COUNTRY CITY RESPONSE UPT BURNED
{flag ? : null}{" "} {countryCode?.toUpperCase() ?? "N/A"} {city} {Math.floor(dataPoint.responseTime)} ms +{dataPoint.uptBurnt}
); }; export default DeviceTicker;