({ name, usedMb, totalMb }: { name: string; usedMb: number; totalMb: number })
| 65 | } |
| 66 | |
| 67 | function GPUStat({ name, usedMb, totalMb }: { name: string; usedMb: number; totalMb: number }) { |
| 68 | const pct = totalMb > 0 ? (usedMb / totalMb) * 100 : 0; |
| 69 | return ( |
| 70 | <Box sx={{ display: "flex", alignItems: "center", gap: 0.8, mr: 0.5, flexShrink: 1, minWidth: 0 }}> |
| 71 | <Box sx={{ position: "relative", display: "inline-flex", flexShrink: 0 }}> |
| 72 | <CircularProgress variant="determinate" value={100} size={28} thickness={5} sx={{ color: "divider" }} /> |
| 73 | <CircularProgress variant="determinate" value={pct} size={28} thickness={5} |
| 74 | sx={{ position: "absolute", left: 0, color: pct > 80 ? "error.main" : pct > 60 ? "warning.main" : "secondary.main" }} /> |
| 75 | </Box> |
| 76 | <Box sx={{ minWidth: 0, overflow: "hidden" }}> |
| 77 | <Typography variant="caption" sx={{ fontWeight: 600, fontSize: "0.7rem", lineHeight: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", maxWidth: 70 }}>{name}</Typography> |
| 78 | <Typography variant="caption" sx={{ color: "text.disabled", fontSize: "0.6rem", display: "block", lineHeight: 1 }}>{fmtGpuMb(usedMb)} / {fmtGpuMb(totalMb)}</Typography> |
| 79 | </Box> |
| 80 | </Box> |
| 81 | ); |
| 82 | } |
| 83 | |
| 84 | function StatBadge({ value, label }: { value: number; label: string }) { |
| 85 | return ( |
nothing calls this directly
no test coverage detected