diff --git a/dashboard/15-final/app/dashboard/invoices/[id]/edit/page.tsx b/dashboard/15-final/app/dashboard/invoices/[id]/edit/page.tsx index c02654ef..35299610 100644 --- a/dashboard/15-final/app/dashboard/invoices/[id]/edit/page.tsx +++ b/dashboard/15-final/app/dashboard/invoices/[id]/edit/page.tsx @@ -1,6 +1,7 @@ import { fetchInvoiceById, fetchCustomerNames } from '@/app/lib/data'; import { notFound } from 'next/navigation'; import Form from '@/app/ui/invoices/edit-form'; +import Breadcrumbs from '@/app/ui/invoices/breadcrumbs'; export default async function Page({ params }: { params: { id: string } }) { const id = params.id; @@ -13,6 +14,16 @@ export default async function Page({ params }: { params: { id: string } }) { return (
+
); diff --git a/dashboard/15-final/app/dashboard/invoices/create/page.tsx b/dashboard/15-final/app/dashboard/invoices/create/page.tsx index b50595f1..3d036cc6 100644 --- a/dashboard/15-final/app/dashboard/invoices/create/page.tsx +++ b/dashboard/15-final/app/dashboard/invoices/create/page.tsx @@ -1,11 +1,22 @@ import { fetchCustomerNames } from '@/app/lib/data'; import Form from '@/app/ui/invoices/create-form'; +import Breadcrumbs from '@/app/ui/invoices/breadcrumbs'; export default async function Page() { const customerNames = await fetchCustomerNames(); return (
+
); diff --git a/dashboard/15-final/app/dashboard/invoices/page.tsx b/dashboard/15-final/app/dashboard/invoices/page.tsx index fd35c3f9..1f4dca15 100644 --- a/dashboard/15-final/app/dashboard/invoices/page.tsx +++ b/dashboard/15-final/app/dashboard/invoices/page.tsx @@ -1,7 +1,7 @@ import Pagination from '@/app/ui/invoices/pagination'; import Search from '@/app/ui/search'; -import { CreateInvoice } from '@/app/ui/invoices/buttons'; import Table from '@/app/ui/invoices/table'; +import { CreateInvoice } from '@/app/ui/invoices/buttons'; import { lusitana } from '@/app/ui/fonts'; import { InvoicesTableSkeleton } from '@/app/ui/dashboard/skeletons'; import { Suspense } from 'react'; @@ -17,6 +17,7 @@ export default async function Page({ }) { const query = searchParams?.query || ''; const currentPage = Number(searchParams?.page) || 1; + const totalPages = await fetchInvoicesPages(query); return ( diff --git a/dashboard/15-final/app/ui/invoices/breadcrumbs.tsx b/dashboard/15-final/app/ui/invoices/breadcrumbs.tsx index 50779a69..cd9e2265 100644 --- a/dashboard/15-final/app/ui/invoices/breadcrumbs.tsx +++ b/dashboard/15-final/app/ui/invoices/breadcrumbs.tsx @@ -8,7 +8,11 @@ interface Breadcrumb { active?: boolean; } -export function Breadcrumbs({ breadcrumbs }: { breadcrumbs: Breadcrumb[] }) { +export default function Breadcrumbs({ + breadcrumbs, +}: { + breadcrumbs: Breadcrumb[]; +}) { return (