fix build
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -8,7 +8,7 @@ import PlusIcon from "@/components/icons/PlusIcon";
|
|||||||
import MinusIcon from "@/components/icons/MinusIcon";
|
import MinusIcon from "@/components/icons/MinusIcon";
|
||||||
import { useCart } from "@/app/[name]/(Dialogs)/cart/hook/useCart";
|
import { useCart } from "@/app/[name]/(Dialogs)/cart/hook/useCart";
|
||||||
import { motion } from "framer-motion";
|
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 {
|
interface MenuItemProps {
|
||||||
food: Food;
|
food: Food;
|
||||||
@@ -33,7 +33,8 @@ const MenuItem = ({ food }: MenuItemProps) => {
|
|||||||
if (Array.isArray(food.images) && food.images.length > 0) {
|
if (Array.isArray(food.images) && food.images.length > 0) {
|
||||||
const [firstImage] = food.images;
|
const [firstImage] = food.images;
|
||||||
if (typeof firstImage === "string") return firstImage;
|
if (typeof firstImage === "string") return firstImage;
|
||||||
return firstImage?.url || fallbackImage;
|
const imageObj = firstImage as FoodImage;
|
||||||
|
return (typeof imageObj === "object" && imageObj?.url) || fallbackImage;
|
||||||
}
|
}
|
||||||
return fallbackImage;
|
return fallbackImage;
|
||||||
}, [food.image, food.images]);
|
}, [food.image, food.images]);
|
||||||
@@ -51,10 +52,6 @@ const MenuItem = ({ food }: MenuItemProps) => {
|
|||||||
return content.filter(item => item && typeof item === 'string').join('، ');
|
return content.filter(item => item && typeof item === 'string').join('، ');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof content === 'string') {
|
|
||||||
return content.replace(/,/g, '،');
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}, [food.content]);
|
}, [food.content]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user