Refactor: Implement Code Splitting

This commit is contained in:
gpt-engineer-app[bot]
2025-10-21 18:31:08 +00:00
parent da0f01a785
commit 70a8534da7
9 changed files with 722 additions and 89 deletions

View File

@@ -0,0 +1,72 @@
import { Skeleton } from '@/components/ui/skeleton';
import { Card, CardContent } from '@/components/ui/card';
export const PageLoader = () => (
<div className="min-h-screen flex items-center justify-center">
<div className="text-center space-y-4">
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto" />
<p className="text-muted-foreground">Loading...</p>
</div>
</div>
);
export const ParkDetailSkeleton = () => (
<div className="container mx-auto px-4 py-8 space-y-6">
<Skeleton className="h-64 w-full rounded-lg" />
<Skeleton className="h-10 w-2/3" />
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
{[...Array(4)].map((_, i) => (
<Skeleton key={i} className="h-20" />
))}
</div>
<Skeleton className="h-40 w-full" />
</div>
);
export const RideCardGridSkeleton = () => (
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{[...Array(6)].map((_, i) => (
<Skeleton key={i} className="h-64 rounded-lg" />
))}
</div>
);
export const AdminFormSkeleton = () => (
<div className="space-y-4 p-6">
<Skeleton className="h-10 w-full" />
<Skeleton className="h-32 w-full" />
<Skeleton className="h-10 w-full" />
<Skeleton className="h-10 w-24" />
</div>
);
export const EditorSkeleton = () => (
<div className="space-y-2">
<Skeleton className="h-10 w-full" />
<Skeleton className="h-64 w-full" />
</div>
);
export const UploadPlaceholder = () => (
<div className="border-2 border-dashed rounded-lg p-8 text-center">
<div className="mx-auto h-12 w-12 rounded-full border-2 border-muted-foreground/20 flex items-center justify-center">
<Skeleton className="h-6 w-6" />
</div>
<p className="mt-2 text-sm text-muted-foreground">Loading uploader...</p>
</div>
);
export const DialogSkeleton = () => (
<Card>
<CardContent className="p-6 space-y-4">
<Skeleton className="h-8 w-48" />
<Skeleton className="h-10 w-full" />
<Skeleton className="h-32 w-full" />
<Skeleton className="h-10 w-full" />
<div className="flex gap-2 justify-end">
<Skeleton className="h-10 w-20" />
<Skeleton className="h-10 w-20" />
</div>
</CardContent>
</Card>
);