import { Badge, Card, Grid } from "antd"; import ArabicPrice from "components/ArabicPrice"; import ImageWithFallback from "components/ImageWithFallback"; import { ItemDescriptionIcons } from "components/ItemDescriptionIcons/ItemDescriptionIcons"; import ProText from "components/ProText"; import ProTitle from "components/ProTitle"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import { useAppSelector } from "redux/hooks"; import { colors } from "ThemeConstants"; import { Product } from "utils/types/appTypes"; import { AddToCartButton } from "pages/menu/components/AddToCartButton/AddToCartButton.tsx"; import styles from "./MenuList.module.css"; interface MenuListProps { data: | { products: Product[]; categories: { id: number; name: string; image?: string }[]; } | undefined; id: string; categoryRefs: React.RefObject<{ [key: number]: HTMLDivElement | null }>; } const { useBreakpoint } = Grid; export function MenuList({ data, categoryRefs }: MenuListProps) { const { isRTL } = useAppSelector((state) => state.locale); const products = data?.products; const { xs, md } = useBreakpoint(); const { items } = useAppSelector((state) => state.order); const restaurantName = localStorage.getItem("restaurantName"); const navigate = useNavigate(); const { t } = useTranslation(); const { themeName } = useAppSelector((state) => state.theme); // Show error state if data exists but has no products if (data && (!data.products || data.products.length === 0)) { return (