summaryrefslogtreecommitdiff
path: root/src/lib/product/components/CategorySection.jsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-07-29 15:23:01 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-07-29 15:23:01 +0700
commita59ed6e73a599a82d6ef248c57ad29f2ab9cb15d (patch)
treed87d37a5dafda05e44123be8a0cf1791d086e3ae /src/lib/product/components/CategorySection.jsx
parentb951ed0de4285076a71f57a0e440b5e68d4a44bd (diff)
<iman> Merge branch 'Feature/category-management' into development
Diffstat (limited to 'src/lib/product/components/CategorySection.jsx')
-rw-r--r--src/lib/product/components/CategorySection.jsx11
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);