Chapter 9 - stream 2nd component (exercise)

This commit is contained in:
2024-01-02 18:20:17 +01:00
parent 1824c019ab
commit 67e324acae
2 changed files with 10 additions and 10 deletions

View File

@@ -2,12 +2,11 @@ import { Card } from '@/app/ui/dashboard/cards';
import RevenueChart from '@/app/ui/dashboard/revenue-chart';
import LatestInvoices from '@/app/ui/dashboard/latest-invoices';
import { lusitana } from '@/app/ui/fonts';
import { fetchLatestInvoices, fetchCardData} from "@/app/lib/data";
import { fetchCardData} from "@/app/lib/data";
import { Suspense } from 'react';
import { RevenueChartSkeleton } from '@/app/ui/skeletons';
import {LatestInvoicesSkeleton, RevenueChartSkeleton} from '@/app/ui/skeletons';
export default async function Page() {
const latestInvoices = await fetchLatestInvoices();
const {
numberOfInvoices,
@@ -34,7 +33,9 @@ export default async function Page() {
<Suspense fallback={<RevenueChartSkeleton />}>
<RevenueChart />
</Suspense>
<LatestInvoices latestInvoices={latestInvoices} />
<Suspense fallback={<LatestInvoicesSkeleton />}>
<LatestInvoices />
</Suspense>
</div>
</main>
);