"use client"; import { Group, SimpleGrid, Stack, Text } from "@mantine/core"; import { IconArrowDown, IconArrowUp, IconCircleCheck, IconCircleX, IconWaveSine } from "@tabler/icons-react"; import type { SpeedtestTrackerResult } from "@homarr/integrations/types"; import { useCurrentLocale, useScopedI18n } from "@homarr/translation/client"; import { formatResultSpeed } from "./helpers"; import { SectionLabel } from "./section-label"; import { SpeedStatCard } from "./speed-stat-card"; export function LatestResultSection({ result }: { result: SpeedtestTrackerResult }) { const t = useScopedI18n("widget.speedtestTracker"); const locale = useCurrentLocale(); const timestamp = Intl.DateTimeFormat(locale, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", }).format(result.created_at); const cols = result.healthy !== null ? 4 : 3; return ( {t("latestResult")} {timestamp} {result.healthy !== null && ( )} ); }