From c5a3a80462db0cb431d70bf4b3f6f1e25bb69dcc Mon Sep 17 00:00:00 2001 From: amel Date: Mon, 16 Jun 2025 17:28:15 +0800 Subject: [PATCH] fix: home Deskripsi: - data kosong pada divisi home - data kosong pada project home No Issues --- components/home/divisionHome.tsx | 45 +++++++++--------- components/home/projectHome.tsx | 79 +++++++++++++++++--------------- 2 files changed, 65 insertions(+), 59 deletions(-) diff --git a/components/home/divisionHome.tsx b/components/home/divisionHome.tsx index 779b435..c2cd598 100644 --- a/components/home/divisionHome.tsx +++ b/components/home/divisionHome.tsx @@ -46,27 +46,30 @@ export default function DivisionHome() { { loading ? : - ( - { router.push(`/division/${data[index].id}`) }} content="carousel" title={data[index].name} headerColor="warning"> - - {data[index].jumlah} - KEGIATAN - - - )} - /> + data.length > 0 ? + ( + { router.push(`/division/${data[index].id}`) }} content="carousel" title={data[index].name} headerColor="warning"> + + {data[index].jumlah} + KEGIATAN + + + )} + /> + : + Tidak ada data } diff --git a/components/home/projectHome.tsx b/components/home/projectHome.tsx index 46a6895..d3f3690 100644 --- a/components/home/projectHome.tsx +++ b/components/home/projectHome.tsx @@ -49,44 +49,47 @@ export default function ProjectHome() { { loading ? () : - ( - { router.push(`/project/${data[index].id}`) }} title={data[index].title} headerColor="primary"> - - - {data[index].createdAt} - - - - )} - /> + data.length > 0 ? + ( + { router.push(`/project/${data[index].id}`) }} title={data[index].title} headerColor="primary"> + + + {data[index].createdAt} + + + + )} + /> + : + Tidak ada data }