diff --git a/app/dashboard/(overview)/page.tsx b/app/dashboard/(overview)/page.tsx index b5a8806..a5dd5dd 100644 --- a/app/dashboard/(overview)/page.tsx +++ b/app/dashboard/(overview)/page.tsx @@ -4,7 +4,8 @@ import LatestInvoices from '@/app/ui/dashboard/latest-invoices'; import { lusitana } from '@/app/ui/fonts'; import { fetchCardData} from "@/app/lib/data"; import { Suspense } from 'react'; -import {LatestInvoicesSkeleton, RevenueChartSkeleton} from '@/app/ui/skeletons'; +import {CardsSkeleton, LatestInvoicesSkeleton, RevenueChartSkeleton} from '@/app/ui/skeletons'; +import CardWrapper from '@/app/ui/dashboard/cards'; export default async function Page() { @@ -20,14 +21,9 @@ export default async function Page() { Dashboard
- - - - + }> + +
}> diff --git a/app/ui/dashboard/cards.tsx b/app/ui/dashboard/cards.tsx index 0ee0286..72e4226 100644 --- a/app/ui/dashboard/cards.tsx +++ b/app/ui/dashboard/cards.tsx @@ -5,6 +5,7 @@ import { InboxIcon, } from '@heroicons/react/24/outline'; import { lusitana } from '@/app/ui/fonts'; +import {fetchCardData} from "@/app/lib/data"; const iconMap = { collected: BanknotesIcon, @@ -14,18 +15,22 @@ const iconMap = { }; export default async function CardWrapper() { + const { + numberOfInvoices, + numberOfCustomers, + totalPaidInvoices, + totalPendingInvoices, + } = await fetchCardData(); return ( <> - {/* NOTE: comment in this code when you get to this point in the course */} - - {/* + */} + /> ); }