diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-07-25 08:27:05 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-07-25 08:27:05 +0700 |
| commit | 2e71abba4ca5b83cc1fec229d4d85961c4b56d71 (patch) | |
| tree | 01889be4eeb5cbd438ebd3bc00e205d3a9e6513d /src/lib/product/components/CategorySection.jsx | |
| parent | 0768abc2828369a0c41a8042e0d005d32b5315ba (diff) | |
<iman> update category management
Diffstat (limited to 'src/lib/product/components/CategorySection.jsx')
| -rw-r--r-- | src/lib/product/components/CategorySection.jsx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/lib/product/components/CategorySection.jsx b/src/lib/product/components/CategorySection.jsx index 14a39e7e..2af3db10 100644 --- a/src/lib/product/components/CategorySection.jsx +++ b/src/lib/product/components/CategorySection.jsx @@ -13,23 +13,16 @@ import { HeartIcon, } from '@heroicons/react/24/outline'; import { useState } from 'react'; // Import useState +import { getIdFromSlug } from '@/core/utils/slug' const CategorySection = ({ categories }) => { const { isDesktop, isMobile } = useDevice(); - const router = useRouter(); const [isOpenCategory, setIsOpenCategory] = useState(false); // State to manage category visibility - let teks = router.query.slug; - let hasil = teks?.match(/(\d+)$/)[0]; - - const breadcrumbs = useQuery( - `category-breadcrumbs/${hasil}`, - async () => await odooApi('GET', `/api/v1/category/${hasil}/category-breadcrumb`) - ); - const handleToggleCategories = () => { setIsOpenCategory(!isOpenCategory); }; + const displayedCategories = isOpenCategory ? categories : categories.slice(0, 10); |
