项目文件夹

文件
2026-07-13 12:58:18 +08:00

37 行
1.1 KiB
TypeScript

此文件含有模棱两可的 Unicode 字符
此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。
"use client";
import { Card } from "@/components/ui/card";
import { Skeleton } from "@/components/ui/skeleton";
function CardSkeleton({ height }: { height: number }) {
return (
<Card className="gap-4 p-4">
<Skeleton className="h-5 w-32 rounded-full" />
<Skeleton className="w-full rounded-lg" style={{ height }} />
</Card>
);
}
/** Loading state mirroring the dashboard grid: KPI row + 2×2 chart/list grid. */
export function DashboardSkeleton() {
return (
<div className="space-y-4">
<div className="grid grid-cols-2 gap-3 lg:grid-cols-4">
{Array.from({ length: 4 }).map((_, i) => (
<Skeleton key={i} className="h-[112px] w-full rounded-xl" />
))}
</div>
<div className="grid grid-cols-1 gap-4 lg:grid-cols-3">
<div className="lg:col-span-2">
<CardSkeleton height={220} />
</div>
<CardSkeleton height={200} />
<CardSkeleton height={180} />
<CardSkeleton height={180} />
<div className="lg:col-span-3">
<CardSkeleton height={220} />
</div>
</div>
</div>
);
}