fix design bug

This commit is contained in:
hamid zarghami
2025-12-28 15:23:41 +03:30
parent 434cb99051
commit 0da06994b6
4 changed files with 15 additions and 8 deletions
+11 -4
View File
@@ -115,10 +115,17 @@ const MenuIndex = () => {
!search || itemName.toLowerCase().includes(lowerSearch);
const matchesIngredients = !selectedIngredients ||
(item.content && Array.isArray(item.content) &&
item.content.some((content: string) =>
content.toLowerCase().includes(lowerIngredients)
));
(() => {
// ابتدا در محتویات جستجو می‌کنیم
if (item.content && Array.isArray(item.content) && item.content.length > 0) {
return item.content.some((content: string) =>
content.toLowerCase().includes(lowerIngredients)
);
}
// اگر محتویات وجود نداشت یا خالی بود، در توضیحات جستجو می‌کنیم
const description = item.description || item.desc || "";
return description.toLowerCase().includes(lowerIngredients);
})();
const matchesDelivery = selectedDeliveryId === "0" ||
(selectedDeliveryId === "pickup" && item.pickupServe) ||