File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ export default async function Page({
35
35
< Search placeholder = "Search invoices..." />
36
36
< CreateInvoice />
37
37
</ div >
38
- < Suspense key = { query + currentPage } fallback = { < InvoicesTableSkeleton /> } >
39
- < Table query = { query } currentPage = { currentPage } />
38
+ < Suspense key = { query ?? 0 + currentPage ?? 1 } fallback = { < InvoicesTableSkeleton /> } >
39
+ < Table query = { query ?? 0 } currentPage = { currentPage } />
40
40
</ Suspense >
41
41
< div className = "mt-5 flex w-full justify-center" >
42
- < Pagination totalPages = { totalPages } />
42
+ < Pagination totalPages = { totalPages ?? 1 } />
43
43
</ div >
44
44
</ div >
45
45
) ;
Original file line number Diff line number Diff line change @@ -16,11 +16,11 @@ const iconMap = {
16
16
17
17
export default async function CardWrapper ( ) {
18
18
const {
19
- numberOfInvoices,
20
- numberOfCustomers,
21
- totalPaidInvoices,
22
- totalPendingInvoices,
23
- } = await fetchCardData ( ) ;
19
+ numberOfInvoices = 0 ,
20
+ numberOfCustomers = 0 ,
21
+ totalPaidInvoices = "0" ,
22
+ totalPendingInvoices = "0" ,
23
+ } = await fetchCardData ( ) ?? { } ;
24
24
25
25
return (
26
26
< >
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default async function LatestInvoices() {
14
14
</ h2 >
15
15
< div className = "flex grow flex-col justify-between rounded-xl bg-gray-50 p-4" >
16
16
< div className = "bg-white px-6" >
17
- { latestInvoices . map ( ( invoice , i ) => {
17
+ { latestInvoices && latestInvoices . map ( ( invoice , i ) => {
18
18
return (
19
19
< div
20
20
key = { invoice . id }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { fetchRevenue } from '@/app/lib/data';
10
10
// https://airbnb.io/visx/
11
11
12
12
export default async function RevenueChart ( ) {
13
- const revenue = await fetchRevenue ( ) ;
13
+ const revenue = await fetchRevenue ( ) ?? [ ] ;
14
14
15
15
const chartHeight = 350 ;
16
16
You can’t perform that action at this time.
0 commit comments