import ProText from "components/ProText"; import ProTitle from "components/ProTitle"; import { useTranslation } from "react-i18next"; import { useAppSelector } from "redux/hooks"; import { Product } from "utils/types/appTypes"; import styles from "./MenuList.module.css"; import ProductCard from "pages/menu/components/MenuList/ProductCard.tsx"; import { ProductBottomSheet } from "pages/product/components/ProductBottomSheet"; import { useState } from "react"; import { Category } from "utils/types/appTypes"; interface MenuListProps { data: | { products: Product[]; categories: { id: number; name: string; image?: string }[]; } | undefined; categoryRefs: React.RefObject<{ [key: number]: HTMLDivElement | null }>; } export function MenuList({ data, categoryRefs }: MenuListProps) { const { isRTL } = useAppSelector((state) => state.locale); const products = data?.products; const [isBottomSheetOpen, setIsBottomSheetOpen] = useState(false); 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 (