import { useTranslation } from "react-i18next"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { useModelStats } from "@/lib/query/usage"; import { fmtUsd } from "./format"; interface ModelStatsTableProps { appType?: string; refreshIntervalMs: number; } export function ModelStatsTable({ appType, refreshIntervalMs, }: ModelStatsTableProps) { const { t } = useTranslation(); const { data: stats, isLoading } = useModelStats(appType, { refetchInterval: refreshIntervalMs > 0 ? refreshIntervalMs : false, }); if (isLoading) { return
; } return (