diff --git a/src/app/campaigns/[id]/page.tsx b/src/app/campaigns/[id]/page.tsx index e25c5df..692cdee 100644 --- a/src/app/campaigns/[id]/page.tsx +++ b/src/app/campaigns/[id]/page.tsx @@ -8,11 +8,11 @@ import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table' -import { - Heart, - Calendar, - MapPin, - Users, +import { + Heart, + Calendar, + MapPin, + Users, TrendingUp, ArrowLeft, Share2, @@ -23,6 +23,13 @@ import Link from 'next/link' import { formatAmount, formatDate } from '@/lib/utils' import { useState } from 'react' import { toast } from 'sonner' +import { useEffect, useState } from 'react' + +import { + CampaignCardSkeleton, + StatsCardSkeleton, + TableRowSkeleton, +} from '@/components/features/loading/skeleton-card' export default function CampaignDetailPage({ params }: { params: { id: string } }) { const [donationAmount, setDonationAmount] = useState('') @@ -81,12 +88,76 @@ export default function CampaignDetailPage({ params }: { params: { id: string } } } + const [isLoading, setIsLoading] = useState(true) + + useEffect(() => { + const timer = setTimeout(() => { + setIsLoading(false) + }, 1000) + + return () => clearTimeout(timer) + }, []) + + if (isLoading) { + return ( +
+ + +
+
+ +
+ +
+
+ {/* Header */} + + + {/* Funding stats */} +
+ + + +
+ + {/* Progress section */} + + + {/* Campaign details */} + + + {/* Beneficiaries / Donations table */} + + +
+ + + + + +
+
+
+
+ + {/* Sidebar */} +
+ + + +
+
+
+
+ ) + } + const progress = (campaign.raisedAmount / campaign.targetAmount) * 100 return (
- +