mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
- Implement loading states for dashboard, project, and video views - Introduce skeleton UIs for settings pages - Add skeletons for Navbar and charts - Enhance `Skeleton` component with a text variant - Improve perceived performance during data fetching - Update `.gitignore` with `Optimization.md`
49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
import { Skeleton } from "@/components/ui/skeleton"
|
|
import { Card, CardHeader, CardContent } from "@/components/ui/card"
|
|
|
|
function ProjectCardSkeleton() {
|
|
return (
|
|
<Card className="h-full">
|
|
<CardHeader>
|
|
<div className="flex items-start justify-between">
|
|
<div className="flex items-center gap-2">
|
|
<Skeleton className="h-5 w-5 rounded" />
|
|
<Skeleton className="h-5 w-32" />
|
|
</div>
|
|
<Skeleton className="h-5 w-16 rounded-full" />
|
|
</div>
|
|
<Skeleton className="h-4 w-20 rounded-full mt-1" />
|
|
<Skeleton className="h-4 w-full mt-1" />
|
|
<Skeleton className="h-4 w-2/3" />
|
|
</CardHeader>
|
|
<CardContent>
|
|
<div className="flex items-center gap-4">
|
|
<Skeleton className="h-4 w-14" />
|
|
<Skeleton className="h-4 w-8" />
|
|
<Skeleton className="h-4 w-16" />
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
)
|
|
}
|
|
|
|
export default function DashboardLoading() {
|
|
return (
|
|
<div className="px-6 lg:px-8 py-8 w-full">
|
|
<div className="flex items-center justify-between mb-8">
|
|
<div className="flex items-center gap-4">
|
|
<Skeleton className="h-9 w-40" />
|
|
<Skeleton className="h-9 w-[200px] rounded-md" />
|
|
</div>
|
|
<Skeleton className="h-9 w-32 rounded-md" />
|
|
</div>
|
|
|
|
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
|
|
{Array.from({ length: 6 }).map((_, i) => (
|
|
<ProjectCardSkeleton key={i} />
|
|
))}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|