diff --git a/dashboard/final-example/app/ui/invoices/buttons.tsx b/dashboard/final-example/app/ui/invoices/buttons.tsx index bbae714..eed4d4f 100644 --- a/dashboard/final-example/app/ui/invoices/buttons.tsx +++ b/dashboard/final-example/app/ui/invoices/buttons.tsx @@ -1,5 +1,6 @@ import { PencilIcon, PlusIcon, TrashIcon } from '@heroicons/react/24/outline'; import Link from 'next/link'; +import { deleteInvoice } from '@/app/lib/actions'; export function CreateInvoice() { return ( @@ -24,11 +25,14 @@ export function UpdateInvoice({ id }: { id: string }) { ); } -export function DeleteInvoice() { +export function DeleteInvoice({ id }: { id: string }) { return ( - +
+ + +
); } diff --git a/dashboard/final-example/app/ui/invoices/create-form.tsx b/dashboard/final-example/app/ui/invoices/create-form.tsx index f60a5ef..4056179 100644 --- a/dashboard/final-example/app/ui/invoices/create-form.tsx +++ b/dashboard/final-example/app/ui/invoices/create-form.tsx @@ -9,6 +9,7 @@ import { UserCircleIcon, } from '@heroicons/react/24/outline'; import { Button } from '../button'; +import { createInvoice } from '@/app/lib/actions'; export default function Form({ customers }: { customers: CustomerField[] }) { return ( @@ -25,6 +26,7 @@ export default function Form({ customers }: { customers: CustomerField[] }) { name="customerId" className="peer block w-full rounded-md border border-gray-200 py-2 pl-10 text-sm outline-2 placeholder:text-gray-500" defaultValue="" + aria-describedby="customer-error" >