From d70ac2945e8755cbb63c60ad260d442e8f71ca74 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Wed, 8 Oct 2025 11:12:20 +0700 Subject: breadcrumb prod detail --- .../modules/product-detail/components/Breadcrumb.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src-migrate') diff --git a/src-migrate/modules/product-detail/components/Breadcrumb.tsx b/src-migrate/modules/product-detail/components/Breadcrumb.tsx index a0f983d0..67aa12ab 100644 --- a/src-migrate/modules/product-detail/components/Breadcrumb.tsx +++ b/src-migrate/modules/product-detail/components/Breadcrumb.tsx @@ -19,6 +19,7 @@ const Breadcrumb = ({ id, name }: Props) => { const breadcrumbs = data ?? []; const total = breadcrumbs.length; const lastCat = total ? breadcrumbs[total - 1] : null; + const prevCat = total > 1 ? breadcrumbs[total - 2] : null; const hasHidden = total > 1; const hiddenText = hasHidden ? breadcrumbs @@ -36,16 +37,18 @@ const Breadcrumb = ({ id, name }: Props) => { ); - if (hasHidden) { + if (hasHidden && prevCat) { + // Jadikan ".." sebuah tautan ke kategori sebelumnya crumbsMobile.push( - .. - + ); } -- cgit v1.2.3