mirror of
https://github.com/BradNut/nextjs-dashboard
synced 2025-09-08 17:40:30 +00:00
32 lines
754 B
TypeScript
32 lines
754 B
TypeScript
import { notFound } from "next/navigation";
|
|
import Form from "@/app/ui/invoices/edit-form";
|
|
import Breadcrumbs from "@/app/ui/invoices/breadcrumbs";
|
|
import { fetchCustomers, fetchInvoiceById } from "@/app/lib/data";
|
|
|
|
export default async function Page({ params }: { params: { id: string } }) {
|
|
const id = params.id;
|
|
const [invoice, customers] = await Promise.all([
|
|
fetchInvoiceById(id),
|
|
fetchCustomers(),
|
|
]);
|
|
|
|
if (!invoice) {
|
|
notFound();
|
|
}
|
|
|
|
return (
|
|
<main>
|
|
<Breadcrumbs
|
|
breadcrumbs={[
|
|
{ label: "Invoices", href: "/dashboard/invoices" },
|
|
{
|
|
label: "Edit Invoice",
|
|
href: `/dashboard/invoices/${id}/edit`,
|
|
active: true,
|
|
},
|
|
]}
|
|
/>
|
|
<Form invoice={invoice} customers={customers} />
|
|
</main>
|
|
);
|
|
}
|