diff --git a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/page.tsx b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/page.tsx index e32ab10..cbf9df3 100644 --- a/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/page.tsx +++ b/teressa-copeland-homes/src/app/portal/(protected)/documents/[docId]/page.tsx @@ -2,9 +2,10 @@ import { auth } from '@/lib/auth'; import { redirect } from 'next/navigation'; import { db } from '@/lib/db'; import { documents, clients } from '@/lib/db/schema'; -import { eq } from 'drizzle-orm'; +import { eq, asc } from 'drizzle-orm'; import Link from 'next/link'; import { PdfViewerWrapper } from './_components/PdfViewerWrapper'; +import { PreparePanel } from './_components/PreparePanel'; export default async function DocumentPage({ params, @@ -16,10 +17,13 @@ export default async function DocumentPage({ const { docId } = await params; - const doc = await db.query.documents.findFirst({ - where: eq(documents.id, docId), - with: { client: true }, - }); + const [doc, allClients] = await Promise.all([ + db.query.documents.findFirst({ + where: eq(documents.id, docId), + with: { client: true }, + }), + db.select().from(clients).orderBy(asc(clients.name)), + ]); if (!doc) redirect('/portal/dashboard'); @@ -34,10 +38,25 @@ export default async function DocumentPage({ ← Back to {doc.client?.name ?? 'Client'}
{doc.client?.name}
++ {doc.client?.name} · {doc.status} +
+ + + +