mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:56:28 +00:00
8478b1f28f
Add dedicated 403 pages for the app and admin area, enable Next.js forbidden handling, and improve admin loading, navigation, and error-boundary experiences.
94 lines
5.6 KiB
TypeScript
94 lines
5.6 KiB
TypeScript
import { FC } from 'react';
|
|
import { Card, CardContent, CardHeader } from '@/components/ui/card';
|
|
|
|
export default function AdminLoading() {
|
|
return (
|
|
<div className="flex flex-col space-y-4 w-full">
|
|
<Card className="border-zinc-200/90 dark:border-zinc-800/90">
|
|
{/* Header Skeleton */}
|
|
<CardHeader className="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 pb-4">
|
|
<div className="space-y-2">
|
|
{/* Title skeleton */}
|
|
<div className="h-7 w-44 rounded-md bg-zinc-200 dark:bg-zinc-800 animate-pulse" />
|
|
{/* Description skeleton */}
|
|
<div className="h-4 w-72 max-w-full rounded-md bg-zinc-100 dark:bg-zinc-850 animate-pulse" />
|
|
</div>
|
|
|
|
{/* Action button skeleton */}
|
|
<div className="h-9 w-32 rounded-lg bg-zinc-200/80 dark:bg-zinc-800 animate-pulse shrink-0" />
|
|
</CardHeader>
|
|
|
|
<CardContent className="space-y-4">
|
|
{/* Search & Filter Toolbar Skeleton */}
|
|
<div className="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3">
|
|
<div className="h-8 w-full sm:w-64 rounded-md bg-zinc-100 dark:bg-zinc-900 border border-zinc-200 dark:border-zinc-800 animate-pulse" />
|
|
<div className="flex items-center gap-2 self-end sm:self-auto">
|
|
<div className="h-8 w-24 rounded-md bg-zinc-100 dark:bg-zinc-850 animate-pulse" />
|
|
</div>
|
|
</div>
|
|
|
|
{/* Table Skeleton */}
|
|
<div className="w-full rounded-lg border border-zinc-200/80 dark:border-zinc-800/80 overflow-hidden">
|
|
{/* Table Header Row */}
|
|
<div className="h-10 bg-zinc-50 dark:bg-zinc-900/90 border-b border-zinc-200 dark:border-zinc-800 flex items-center px-4 gap-4">
|
|
<div className="h-3.5 w-8 rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse" />
|
|
<div className="h-3.5 w-32 rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse" />
|
|
<div className="h-3.5 w-24 rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse hidden md:block" />
|
|
<div className="h-3.5 w-48 rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse flex-1" />
|
|
<div className="h-3.5 w-16 rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse ml-auto" />
|
|
</div>
|
|
|
|
{/* Table Body Rows */}
|
|
<div className="divide-y divide-zinc-200/70 dark:divide-zinc-800/70 bg-white dark:bg-zinc-950">
|
|
{[1, 2, 3, 4, 5, 6].map((i) => (
|
|
<div
|
|
key={i}
|
|
className="h-14 flex items-center px-4 gap-4 transition-colors"
|
|
>
|
|
{/* Num / Index */}
|
|
<div className="h-3 w-6 rounded bg-zinc-200/70 dark:bg-zinc-800/70 animate-pulse" />
|
|
|
|
{/* Primary title + subtitle */}
|
|
<div className="space-y-1.5 flex-1 sm:flex-initial sm:w-48">
|
|
<div
|
|
className="h-3.5 rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse"
|
|
style={{ width: `${65 + (i * 7) % 30}%` }}
|
|
/>
|
|
<div className="h-2.5 w-24 rounded bg-zinc-100 dark:bg-zinc-850 animate-pulse" />
|
|
</div>
|
|
|
|
{/* Badge / Type */}
|
|
<div className="hidden md:block w-24">
|
|
<div className="h-5 w-20 rounded-full bg-zinc-100 dark:bg-zinc-850 animate-pulse" />
|
|
</div>
|
|
|
|
{/* Secondary detail / Description */}
|
|
<div className="hidden lg:block flex-1">
|
|
<div
|
|
className="h-3 rounded bg-zinc-100 dark:bg-zinc-850 animate-pulse"
|
|
style={{ width: `${50 + (i * 11) % 40}%` }}
|
|
/>
|
|
</div>
|
|
|
|
{/* Action button */}
|
|
<div className="h-8 w-8 rounded-md bg-zinc-100 dark:bg-zinc-850 animate-pulse ml-auto" />
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
|
|
{/* Pagination Footer Skeleton */}
|
|
<div className="flex items-center justify-between pt-2">
|
|
<div className="h-4 w-40 rounded bg-zinc-100 dark:bg-zinc-850 animate-pulse" />
|
|
<div className="flex items-center gap-1.5">
|
|
<div className="h-7 w-7 rounded bg-zinc-100 dark:bg-zinc-850 animate-pulse" />
|
|
<div className="h-7 w-7 rounded bg-zinc-200 dark:bg-zinc-800 animate-pulse" />
|
|
<div className="h-7 w-7 rounded bg-zinc-100 dark:bg-zinc-850 animate-pulse" />
|
|
</div>
|
|
</div>
|
|
</CardContent>
|
|
</Card>
|
|
</div>
|
|
);
|
|
}
|