"use client"; import { usePoll } from "@/lib/use-poll"; import type { OverviewStats } from "@/lib/types"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { StatusBadge } from "./status-badge"; import { CardSkeleton } from "@/components/skeleton"; function tempColor(temp: number): string { if (temp < 50) return "#22c55e"; if (temp < 70) return "#f59e0b"; return "#ef4444"; } function vramGradient(pct: number): string { if (pct < 50) return "from-blue-500 to-cyan-400"; if (pct < 80) return "from-blue-500 via-violet-500 to-purple-400"; return "from-violet-500 via-pink-500 to-red-400"; } function MiniRing({ pct, color, size = 48, stroke = 4, children }: { pct: number; color: string; size?: number; stroke?: number; children?: React.ReactNode }) { const radius = (size - stroke) / 2; const circumference = 2 * Math.PI * radius; const offset = circumference - (pct / 100) * circumference; return (
{gpu.name}
)} {/* VRAM bar */} {vramUsed != null && vramTotal != null && ({power}W
{gpu.power_limit_w ? `/ ${gpu.power_limit_w}W` : "Power"}
{gpu.utilization_pct}%
Util
GPU not available
)}