diff --git a/src/app/[name]/(Main)/components/CategoryScroll.tsx b/src/app/[name]/(Main)/components/CategoryScroll.tsx index cd347ef..f25fd66 100644 --- a/src/app/[name]/(Main)/components/CategoryScroll.tsx +++ b/src/app/[name]/(Main)/components/CategoryScroll.tsx @@ -53,7 +53,7 @@ const CategoryScroll = ({ className )} > - همه - + */} {categories.map((item, index) => { - const categoryIndex = index + 1; + const categoryIndex = index; const isSelected = String(categoryIndex) === selectedCategory; return ( diff --git a/src/app/[name]/(Main)/page.tsx b/src/app/[name]/(Main)/page.tsx index 64948a9..862c6a3 100644 --- a/src/app/[name]/(Main)/page.tsx +++ b/src/app/[name]/(Main)/page.tsx @@ -106,12 +106,10 @@ const MenuIndex = () => { if (!foods.length) return []; const lowerSearch = search.toLowerCase(); const lowerIngredients = selectedIngredients ? selectedIngredients.toLowerCase() : ""; - const selectedCatId = - selectedCategory === "0" ? null : categories[+selectedCategory - 1]?.id; + const selectedCatId = categories[+selectedCategory]?.id; const filtered = foods.filter((item) => { - const matchesCategory = - selectedCategory === "0" || item.category?.id === selectedCatId; + const matchesCategory = item.category?.id === selectedCatId; const itemName = item.name || item.title || item.foodName || ""; const matchesSearch = !search || itemName.toLowerCase().includes(lowerSearch); @@ -163,11 +161,11 @@ const MenuIndex = () => { - - - {selectedCategory === '0' ? 'همه' : categories[+selectedCategory - 1]?.title || ''} + + + {categories[+selectedCategory]?.title || ''} - + {tMenu('MenuFilterDrawer.Label')}