import { StatusDot } from "@/components/status-dot" interface DataFreshnessProps { /** Время последнего успешного получения данных (мс), null — данных ещё нет. */ at: number | null live: boolean } /** Свежесть данных в шапке страницы: «Обновлено 14:02 · Live» или «Демо-данные». */ export function DataFreshness({ at, live }: DataFreshnessProps) { const text = !live ? "Демо-данные" : at == null ? "Данные ещё не получены" : `Обновлено ${new Date(at).toLocaleTimeString("ru-RU", { hour: "2-digit", minute: "2-digit" })} · Live` return ( {live && at != null ? : text} ) }