"use client"; import { motion } from "framer-motion"; import { cn } from "@/lib/utils"; /** A metric with an optional usage bar. Bar colour escalates with pressure — * a disk at 94% should not look the same as one at 12%. */ export function StatCard({ label, value, sub, pct, index = 0, }: { label: string; value: React.ReactNode; sub?: React.ReactNode; pct?: number | null; index?: number; }) { const tone = pct == null ? "bg-accent" : pct >= 90 ? "bg-err" : pct >= 75 ? "bg-warn" : "bg-accent"; return (
{label}
{value}
{sub &&
{sub}
} {pct != null && (
)}
); }