fix build

This commit is contained in:
hamid zarghami
2025-12-20 15:31:19 +03:30
parent a4ccc78dd5
commit 668172e8ee
2 changed files with 4 additions and 7 deletions
+3 -6
View File
@@ -8,7 +8,7 @@ import PlusIcon from "@/components/icons/PlusIcon";
import MinusIcon from "@/components/icons/MinusIcon";
import { useCart } from "@/app/[name]/(Dialogs)/cart/hook/useCart";
import { motion } from "framer-motion";
import type { Food } from "@/app/[name]/(Main)/types/Types";
import type { Food, FoodImage } from "@/app/[name]/(Main)/types/Types";
interface MenuItemProps {
food: Food;
@@ -33,7 +33,8 @@ const MenuItem = ({ food }: MenuItemProps) => {
if (Array.isArray(food.images) && food.images.length > 0) {
const [firstImage] = food.images;
if (typeof firstImage === "string") return firstImage;
return firstImage?.url || fallbackImage;
const imageObj = firstImage as FoodImage;
return (typeof imageObj === "object" && imageObj?.url) || fallbackImage;
}
return fallbackImage;
}, [food.image, food.images]);
@@ -51,10 +52,6 @@ const MenuItem = ({ food }: MenuItemProps) => {
return content.filter(item => item && typeof item === 'string').join('، ');
}
if (typeof content === 'string') {
return content.replace(/,/g, '،');
}
return '';
}, [food.content]);