fix build
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user