From c29d1463b0d993113008ff9c334c67464ff9e84b Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Sat, 26 Aug 2023 13:18:12 +0530 Subject: [PATCH] chore: updated documents page Signed-off-by: Adithya Krishna --- .../src/app/(dashboard)/documents/page.tsx | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/apps/web/src/app/(dashboard)/documents/page.tsx b/apps/web/src/app/(dashboard)/documents/page.tsx index 4ea55936b..a133ebbd2 100644 --- a/apps/web/src/app/(dashboard)/documents/page.tsx +++ b/apps/web/src/app/(dashboard)/documents/page.tsx @@ -58,6 +58,12 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage return `/documents?${params.toString()}`; }; + const documentStatuses = [ + InternalDocumentStatus.PENDING, + InternalDocumentStatus.COMPLETED, + InternalDocumentStatus.DRAFT, + ]; + return (
@@ -67,25 +73,21 @@ export default async function DocumentsPage({ searchParams = {} }: DocumentsPage
- {[ - ExtendedDocumentStatus.INBOX, - ExtendedDocumentStatus.PENDING, - ExtendedDocumentStatus.COMPLETED, - ExtendedDocumentStatus.DRAFT, - ExtendedDocumentStatus.ALL, - ].map((value) => ( - - - + {documentStatuses.map((status) => ( + + + - {value !== ExtendedDocumentStatus.ALL && ( - - {Math.min(stats[value], 99)} - - )} + + {Math.min(stats[status], 99)} + ))} + + + All +