import { Stack, Typography, List, ListItem } from "@mui/material"; import { useTheme } from "@emotion/react"; import PulseDot from "../../../../../Components/Animated/PulseDot"; import "/node_modules/flag-icons/css/flag-icons.min.css"; 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.slice(Math.max(data.length - 5, 0)).map((dataPoint) => { const countryCode = dataPoint?.countryCode?.toLowerCase() ?? null; const flag = countryCode ? `fi fi-${countryCode}` : null; return ( {flag && } {dataPoint?.city || "Unknown"} {`Response time: ${Math.floor(dataPoint?.responseTime ?? 0)} ms`} {`UPT burned: ${dataPoint.uptBurnt}`} {`${dataPoint?.device?.manufacturer} ${dataPoint?.device?.model}`} ); })} ); }; export default DeviceTicker;