From 9b2ac9beeeba3fc656af2c27266926d1a07d6cef Mon Sep 17 00:00:00 2001 From: dwindown Date: Fri, 26 Dec 2025 01:53:30 +0700 Subject: [PATCH] Hide Quick Access section when no scheduled events available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Check if quickAccessItems has any items before rendering section - If no consulting/webinar events qualify, entire section is hidden - Prevents empty "Akses Cepat" section from showing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- src/pages/member/MemberDashboard.tsx | 67 ++++++++++++++++------------ 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/src/pages/member/MemberDashboard.tsx b/src/pages/member/MemberDashboard.tsx index a1e3b8a..3524e30 100644 --- a/src/pages/member/MemberDashboard.tsx +++ b/src/pages/member/MemberDashboard.tsx @@ -287,37 +287,46 @@ export default function MemberDashboard() { {access.length > 0 && (
-
-

Akses Cepat

- -
-
- {access + {(() => { + const quickAccessItems = access .map((item) => ({ item, action: getQuickAction(item) })) .filter(({ action }) => action !== null) - .slice(0, 3) - .map(({ item, action }) => ( - - - {item.product.title} - {item.product.type} - - - {action && action.href && ( - - )} - - - ))} -
+ .slice(0, 3); + + if (quickAccessItems.length === 0) return null; + + return ( + <> +
+

Akses Cepat

+ +
+
+ {quickAccessItems.map(({ item, action }) => ( + + + {item.product.title} + {item.product.type} + + + {action && action.href && ( + + )} + + + ))} +
+ + ); + })()}
)}