From 6005a4871cc061a820d554054f6db6010bbb021b Mon Sep 17 00:00:00 2001 From: Manuel Ruck Date: Sat, 30 Nov 2024 09:01:41 +0100 Subject: [PATCH] feat(admin): show description if procedure list is empty Signed-off-by: Manuel Ruck --- bundestag.io/admin/src/app/list/past/page.tsx | 36 +++++++++++-------- .../admin/src/app/list/upcoming/page.tsx | 35 ++++++++++-------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/bundestag.io/admin/src/app/list/past/page.tsx b/bundestag.io/admin/src/app/list/past/page.tsx index ea580072..7788ac78 100644 --- a/bundestag.io/admin/src/app/list/past/page.tsx +++ b/bundestag.io/admin/src/app/list/past/page.tsx @@ -34,21 +34,27 @@ export default async function Page({ searchParams }: { searchParams: { page?: st return ( <>

Past procedures

- - - {procedures.map((procedure) => ( - ({ - party: vote.party, - decision: vote.main, - }))} - /> - ))} - - + + {totalPages === 0 &&

There are no past procedures.

} + {totalPages > 0 && ( + <> + + + {procedures.map((procedure) => ( + ({ + party: vote.party, + decision: vote.main, + }))} + /> + ))} + + + + )} ); } diff --git a/bundestag.io/admin/src/app/list/upcoming/page.tsx b/bundestag.io/admin/src/app/list/upcoming/page.tsx index 7018ab70..038282a2 100644 --- a/bundestag.io/admin/src/app/list/upcoming/page.tsx +++ b/bundestag.io/admin/src/app/list/upcoming/page.tsx @@ -35,21 +35,26 @@ export default async function Page({ searchParams }: { searchParams: { page?: st <>

Upcoming procedures

- - - {procedures.map((procedure) => ( - ({ - party: vote.party, - decision: vote.main, - }))} - /> - ))} - - + {totalPages === 0 &&

There are no upcoming procedures.

} + {totalPages > 0 && ( + <> + + + {procedures.map((procedure) => ( + ({ + party: vote.party, + decision: vote.main, + }))} + /> + ))} + + + + )} ); }