Files
goodgo-platform/apps/web/app/[locale]/(dashboard)/loading.tsx
Ho Ngoc Hai 7195064f12 feat(web): add i18n locale routes and language switcher component
Add locale-prefixed routes for admin, auth, dashboard, and public pages.
Add error, loading, and not-found pages for locale context. Add language
switcher UI component for Vietnamese/English toggle.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-09 09:44:18 +07:00

72 lines
3.0 KiB
TypeScript

export default function DashboardLoading() {
return (
<div className="space-y-8">
{/* Header skeleton */}
<div className="flex items-center justify-between">
<div>
<div className="h-8 w-48 animate-pulse rounded bg-muted" />
<div className="mt-2 h-4 w-72 animate-pulse rounded bg-muted" />
</div>
<div className="h-10 w-28 animate-pulse rounded-md bg-muted" />
</div>
{/* Stats grid skeleton */}
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
{Array.from({ length: 4 }).map((_, i) => (
<div key={i} className="rounded-lg border bg-card p-6 shadow-sm">
<div className="h-4 w-24 animate-pulse rounded bg-muted" />
<div className="mt-3 h-7 w-16 animate-pulse rounded bg-muted" />
<div className="mt-2 h-3 w-32 animate-pulse rounded bg-muted" />
</div>
))}
</div>
{/* Chart + sidebar skeleton */}
<div className="grid gap-6 lg:grid-cols-3">
<div className="rounded-lg border bg-card p-6 shadow-sm lg:col-span-2">
<div className="h-5 w-40 animate-pulse rounded bg-muted" />
<div className="mt-2 h-4 w-56 animate-pulse rounded bg-muted" />
<div className="mt-6 h-64 animate-pulse rounded bg-muted" />
</div>
<div className="rounded-lg border bg-card p-6 shadow-sm">
<div className="h-5 w-36 animate-pulse rounded bg-muted" />
<div className="mt-2 h-4 w-28 animate-pulse rounded bg-muted" />
<div className="mt-6 space-y-4">
{Array.from({ length: 4 }).map((_, i) => (
<div key={i} className="flex items-center justify-between">
<div className="h-4 w-24 animate-pulse rounded bg-muted" />
<div className="h-4 w-16 animate-pulse rounded bg-muted" />
</div>
))}
</div>
</div>
</div>
{/* Recent listings skeleton */}
<div className="rounded-lg border bg-card shadow-sm">
<div className="p-6">
<div className="h-5 w-36 animate-pulse rounded bg-muted" />
<div className="mt-2 h-4 w-56 animate-pulse rounded bg-muted" />
</div>
<div className="px-6 pb-6">
<div className="space-y-3">
{Array.from({ length: 5 }).map((_, i) => (
<div key={i} className="flex items-center gap-4 rounded-lg border p-3">
<div className="h-12 w-16 flex-shrink-0 animate-pulse rounded bg-muted" />
<div className="min-w-0 flex-1">
<div className="h-4 w-3/4 animate-pulse rounded bg-muted" />
<div className="mt-2 h-3 w-1/2 animate-pulse rounded bg-muted" />
</div>
<div className="text-right">
<div className="h-4 w-20 animate-pulse rounded bg-muted" />
<div className="mt-1 h-5 w-16 animate-pulse rounded bg-muted" />
</div>
</div>
))}
</div>
</div>
</div>
</div>
);
}