import { Skeleton } from "@/components/ui/skeleton"; /** * The loading state for Home's two chart cards. Both are a row of * summary figures over a `720 x 240` SVG drawn at `w-full h-auto`, so the * placeholder reserves the same `3:1` box - a card that collapsed to a spinner * and then grew back to chart height was most of what made arriving at the * Home page feel jumpy. Below 560px the charts keep the height they have there * (see `fittedChartWidth`), and so does this. * * `legend` covers the one difference between them: the gas chart carries a * `text-xs` legend under its plot (it doubles as the control for which series * are drawn) and the activity chart has nothing there. Its `mt-2` plus line box * is 24px, which is exactly how much the gas card was still moving without this. */ export function ChartSkeleton({ stats = 3, legend = false, }: { stats?: number; legend?: boolean; }) { return (
{Array.from({ length: stats }, (_, stat) => (
))}
{legend && }
); }