import type { FC, ReactNode } from "react"; import { m } from "@/paraglide/messages"; /** ms → `m:ss`. */ export function fmtDuration(ms: number): string { const s = Math.max(0, Math.floor(ms / 1000)); return `${Math.floor(s / 60)}:${(s % 60).toString().padStart(2, "0")}`; } export function fmtTimestamp(unixMs: number): string { if (!unixMs) return "—"; return new Date(unixMs).toLocaleString(); } export function kindLabel(kind: string): string { if (kind === "gamestream") return m.stats_kind_gamestream(); if (kind === "native") return m.stats_kind_native(); return kind; } export const Stat: FC<{ label: string; value: string }> = ({ label, value, }) => (
{desc}
}