This commit is contained in:
@@ -19,17 +19,7 @@ const SVG_MASK_STYLE = {
|
|||||||
WebkitMaskPosition: "center",
|
WebkitMaskPosition: "center",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
function CategoryImage({
|
function CategoryImage({ src, size, alt, tintWithPrimary = true }: { src: string; size: number; alt: string; tintWithPrimary?: boolean }) {
|
||||||
src,
|
|
||||||
size,
|
|
||||||
alt,
|
|
||||||
tintWithPrimary = true,
|
|
||||||
}: {
|
|
||||||
src: string;
|
|
||||||
size: number;
|
|
||||||
alt: string;
|
|
||||||
tintWithPrimary?: boolean;
|
|
||||||
}) {
|
|
||||||
const isSvg = src.endsWith(".svg");
|
const isSvg = src.endsWith(".svg");
|
||||||
const shouldUseSvgMask = isSvg && tintWithPrimary;
|
const shouldUseSvgMask = isSvg && tintWithPrimary;
|
||||||
|
|
||||||
@@ -93,21 +83,11 @@ type Props = {
|
|||||||
className?: string;
|
className?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const CategoryScroll = ({
|
const CategoryScroll = ({ categories, selectedCategory, onSelect, variant = "large", className }: Props) => {
|
||||||
categories,
|
|
||||||
selectedCategory,
|
|
||||||
onSelect,
|
|
||||||
variant = "large",
|
|
||||||
className,
|
|
||||||
}: Props) => {
|
|
||||||
const segment = usePathname()?.split("/").filter(Boolean)[0];
|
const segment = usePathname()?.split("/").filter(Boolean)[0];
|
||||||
const usesColoredSvg =
|
const usesColoredSvg = segment != null && COLORED_SVG_RESTAURANT_SLUGS.has(segment.toLowerCase());
|
||||||
segment != null &&
|
|
||||||
COLORED_SVG_RESTAURANT_SLUGS.has(segment.toLowerCase());
|
|
||||||
const { renderer: Renderer, imageSize } = variantConfig[variant];
|
const { renderer: Renderer, imageSize } = variantConfig[variant];
|
||||||
const selectedParent =
|
const selectedParent = categories.find((c) => c.id === selectedCategory) ?? categories.find((c) => c.children?.some((ch) => ch.id === selectedCategory));
|
||||||
categories.find((c) => c.id === selectedCategory) ??
|
|
||||||
categories.find((c) => c.children?.some((ch) => ch.id === selectedCategory));
|
|
||||||
const children = selectedParent?.children ?? [];
|
const children = selectedParent?.children ?? [];
|
||||||
|
|
||||||
const handleSelect = (categoryId: string) => () => onSelect(categoryId);
|
const handleSelect = (categoryId: string) => () => onSelect(categoryId);
|
||||||
@@ -118,63 +98,31 @@ const CategoryScroll = ({
|
|||||||
className={clsx(
|
className={clsx(
|
||||||
"w-full noscrollbar",
|
"w-full noscrollbar",
|
||||||
children.length > 0 ? "pt-4! pb-1!" : "py-4!",
|
children.length > 0 ? "pt-4! pb-1!" : "py-4!",
|
||||||
variant === "large" && "mt-4!",
|
// variant === "large" && "mt-4!",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{categories.map((item) => {
|
{categories.map((item) => {
|
||||||
const isSelected =
|
const isSelected = item.id === selectedCategory || item.children?.some((ch) => ch.id === selectedCategory);
|
||||||
item.id === selectedCategory ||
|
|
||||||
item.children?.some((ch) => ch.id === selectedCategory);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Renderer
|
<Renderer key={item.id} className={clsx(isSelected && "bg-container!")} onClick={handleSelect(item.id)}>
|
||||||
key={item.id}
|
<CategoryImage src={item.avatarUrl || "/assets/images/food-image.png"} size={imageSize} alt="category image" tintWithPrimary={!usesColoredSvg} />
|
||||||
className={clsx(isSelected && "bg-container!")}
|
<span className="text-xs text-foreground text-center">{item.title}</span>
|
||||||
onClick={handleSelect(item.id)}
|
|
||||||
>
|
|
||||||
<CategoryImage
|
|
||||||
src={item.avatarUrl || "/assets/images/food-image.png"}
|
|
||||||
size={imageSize}
|
|
||||||
alt="category image"
|
|
||||||
tintWithPrimary={!usesColoredSvg}
|
|
||||||
/>
|
|
||||||
<span className="text-xs text-foreground text-center">
|
|
||||||
{item.title}
|
|
||||||
</span>
|
|
||||||
</Renderer>
|
</Renderer>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
||||||
{children.length > 0 && (
|
{children.length > 0 && (
|
||||||
<HorizontalScrollView
|
<HorizontalScrollView className={clsx("w-full noscrollbar py-2!", variant === "small" && "py-1!")}>
|
||||||
className={clsx(
|
|
||||||
"w-full noscrollbar py-2!",
|
|
||||||
variant === "small" && "py-1!",
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{children.map((child) => {
|
{children.map((child) => {
|
||||||
const isChildSelected = child.id === selectedCategory;
|
const isChildSelected = child.id === selectedCategory;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CategorySmallItemRenderer
|
<CategorySmallItemRenderer key={child.id} compact className={clsx(isChildSelected && "bg-container!")} onClick={handleSelect(child.id)}>
|
||||||
key={child.id}
|
{child.avatarUrl && <CategoryImage src={child.avatarUrl} size={16} alt="category image" tintWithPrimary={!usesColoredSvg} />}
|
||||||
compact
|
<span className="text-[10px] text-foreground whitespace-nowrap">{child.title}</span>
|
||||||
className={clsx(isChildSelected && "bg-container!")}
|
|
||||||
onClick={handleSelect(child.id)}
|
|
||||||
>
|
|
||||||
{child.avatarUrl && (
|
|
||||||
<CategoryImage
|
|
||||||
src={child.avatarUrl}
|
|
||||||
size={16}
|
|
||||||
alt="category image"
|
|
||||||
tintWithPrimary={!usesColoredSvg}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<span className="text-[10px] text-foreground whitespace-nowrap">
|
|
||||||
{child.title}
|
|
||||||
</span>
|
|
||||||
</CategorySmallItemRenderer>
|
</CategorySmallItemRenderer>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
'use client';
|
"use client";
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
||||||
import SearchBox from "@/components/input/SearchBox";
|
|
||||||
import TextAlignIcon from "@/components/icons/TextAlignIcon";
|
|
||||||
import VerticalScrollView from "@/components/listview/VerticalScrollView";
|
|
||||||
import MenuItemRenderer from "@/components/listview/MenuItemRenderer";
|
|
||||||
import MenuItem, { type MenuItemViewMode } from "@/components/listview/MenuItem";
|
|
||||||
import { useQueryState } from "next-usequerystate";
|
|
||||||
import clsx from "clsx";
|
|
||||||
import { motion } from "framer-motion";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import useToggle from "@/hooks/helpers/useToggle";
|
|
||||||
import CategoryScroll from "@/app/[name]/(Main)/components/CategoryScroll";
|
import CategoryScroll from "@/app/[name]/(Main)/components/CategoryScroll";
|
||||||
import MenuFilterDrawer from "@/app/[name]/(Main)/components/MenuFilterDrawer";
|
import MenuFilterDrawer from "@/app/[name]/(Main)/components/MenuFilterDrawer";
|
||||||
import MenuSkeleton from "@/app/[name]/(Main)/components/MenuSkeleton";
|
import MenuSkeleton from "@/app/[name]/(Main)/components/MenuSkeleton";
|
||||||
import { useGetCategories, useGetProducts } from "./hooks/useMenuData";
|
import TextAlignIcon from "@/components/icons/TextAlignIcon";
|
||||||
import type { Product, Category } from "./types/Types";
|
import SearchBox from "@/components/input/SearchBox";
|
||||||
|
import MenuItem, { type MenuItemViewMode } from "@/components/listview/MenuItem";
|
||||||
|
import MenuItemRenderer from "@/components/listview/MenuItemRenderer";
|
||||||
|
import VerticalScrollView from "@/components/listview/VerticalScrollView";
|
||||||
|
import useToggle from "@/hooks/helpers/useToggle";
|
||||||
|
import clsx from "clsx";
|
||||||
|
import { motion } from "framer-motion";
|
||||||
import { RowHorizontal, RowVertical } from "iconsax-react";
|
import { RowHorizontal, RowVertical } from "iconsax-react";
|
||||||
|
import { useQueryState } from "next-usequerystate";
|
||||||
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useGetCategories, useGetProducts } from "./hooks/useMenuData";
|
||||||
|
import type { Category, Product } from "./types/Types";
|
||||||
|
|
||||||
const sortings = ["PopularityDescending", "RateDescending", "PriceAscending", "PriceDescending"] as const;
|
const sortings = ["PopularityDescending", "RateDescending", "PriceAscending", "PriceDescending"] as const;
|
||||||
|
|
||||||
@@ -26,13 +26,13 @@ const MenuIndex = () => {
|
|||||||
const categories = useMemo<Category[]>(() => categoriesData?.data || [], [categoriesData?.data]);
|
const categories = useMemo<Category[]>(() => categoriesData?.data || [], [categoriesData?.data]);
|
||||||
|
|
||||||
const isLoading = productsLoading || categoriesLoading;
|
const isLoading = productsLoading || categoriesLoading;
|
||||||
const { t: tCommon } = useTranslation('common');
|
const { t: tCommon } = useTranslation("common");
|
||||||
const { t: tMenu } = useTranslation('menu', { keyPrefix: "Menu" });
|
const { t: tMenu } = useTranslation("menu", { keyPrefix: "Menu" });
|
||||||
const { state: filterSortModal, toggle: toggleFilterSortModal } = useToggle();
|
const { state: filterSortModal, toggle: toggleFilterSortModal } = useToggle();
|
||||||
const [sorting, setSorting] = useQueryState('sortBy', { defaultValue: '0' });
|
const [sorting, setSorting] = useQueryState("sortBy", { defaultValue: "0" });
|
||||||
const [search, setSearch] = useQueryState("q", { defaultValue: '' });
|
const [search, setSearch] = useQueryState("q", { defaultValue: "" });
|
||||||
const [selectedCategory, setSelectedCategory] = useQueryState('category', { defaultValue: '0' });
|
const [selectedCategory, setSelectedCategory] = useQueryState("category", { defaultValue: "0" });
|
||||||
const [filterSearch, setFilterSearch] = useQueryState('ingredients', { defaultValue: '' });
|
const [filterSearch, setFilterSearch] = useQueryState("ingredients", { defaultValue: "" });
|
||||||
const smallCategoriesRef: React.RefObject<HTMLDivElement | null> = useRef(null);
|
const smallCategoriesRef: React.RefObject<HTMLDivElement | null> = useRef(null);
|
||||||
const wrapperRef: React.RefObject<HTMLDivElement | null> = useRef(null);
|
const wrapperRef: React.RefObject<HTMLDivElement | null> = useRef(null);
|
||||||
const [smallCategoriesVisible, setSmallCategoriesVisibility] = useState(false);
|
const [smallCategoriesVisible, setSmallCategoriesVisibility] = useState(false);
|
||||||
@@ -76,38 +76,49 @@ const MenuIndex = () => {
|
|||||||
const parent = wrapperRef.current.parentElement?.parentElement;
|
const parent = wrapperRef.current.parentElement?.parentElement;
|
||||||
if (!parent) return;
|
if (!parent) return;
|
||||||
|
|
||||||
parent.addEventListener('scroll', onScroll);
|
parent.addEventListener("scroll", onScroll);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
parent.removeEventListener('scroll', onScroll);
|
parent.removeEventListener("scroll", onScroll);
|
||||||
}
|
};
|
||||||
}, [onScroll]);
|
}, [onScroll]);
|
||||||
|
|
||||||
|
const updateSearch = useCallback(
|
||||||
const updateSearch = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
|
(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
setSearch(e.target.value);
|
setSearch(e.target.value);
|
||||||
}, [setSearch]);
|
},
|
||||||
|
[setSearch],
|
||||||
|
);
|
||||||
|
|
||||||
const updateCategory = useCallback((categoryId: string) => {
|
const updateCategory = useCallback(
|
||||||
|
(categoryId: string) => {
|
||||||
setSelectedCategory(categoryId);
|
setSelectedCategory(categoryId);
|
||||||
}, [setSelectedCategory]);
|
},
|
||||||
|
[setSelectedCategory],
|
||||||
|
);
|
||||||
|
|
||||||
const sortingIndex = Number(sorting);
|
const sortingIndex = Number(sorting);
|
||||||
const activeSortingIndex = Number.isNaN(sortingIndex) ? 0 : sortingIndex;
|
const activeSortingIndex = Number.isNaN(sortingIndex) ? 0 : sortingIndex;
|
||||||
|
|
||||||
const changeSorting = useCallback((index: number) => {
|
const changeSorting = useCallback(
|
||||||
|
(index: number) => {
|
||||||
setSorting(() => String(index));
|
setSorting(() => String(index));
|
||||||
}, [setSorting]);
|
},
|
||||||
|
[setSorting],
|
||||||
|
);
|
||||||
|
|
||||||
const changeFilterSearch = useCallback((value: string) => {
|
const changeFilterSearch = useCallback(
|
||||||
|
(value: string) => {
|
||||||
setFilterSearch(value);
|
setFilterSearch(value);
|
||||||
}, [setFilterSearch]);
|
},
|
||||||
|
[setFilterSearch],
|
||||||
|
);
|
||||||
|
|
||||||
const filteredReceiptItems = useMemo(() => {
|
const filteredReceiptItems = useMemo(() => {
|
||||||
if (!products.length) return [];
|
if (!products.length) return [];
|
||||||
const lowerSearch = search.toLowerCase();
|
const lowerSearch = search.toLowerCase();
|
||||||
const lowerFilterQuery = filterSearch ? filterSearch.toLowerCase() : "";
|
const lowerFilterQuery = filterSearch ? filterSearch.toLowerCase() : "";
|
||||||
const selectedCatId = selectedCategory === '0' ? null : selectedCategory;
|
const selectedCatId = selectedCategory === "0" ? null : selectedCategory;
|
||||||
|
|
||||||
// اگر دستهٔ اصلی انتخاب شده، خودش + همهٔ زیردستهها را در نظر بگیر تا غذاهای زیردسته هم بیایند
|
// اگر دستهٔ اصلی انتخاب شده، خودش + همهٔ زیردستهها را در نظر بگیر تا غذاهای زیردسته هم بیایند
|
||||||
const effectiveCategoryIds = (() => {
|
const effectiveCategoryIds = (() => {
|
||||||
@@ -120,24 +131,20 @@ const MenuIndex = () => {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
const filtered = products.filter((item) => {
|
const filtered = products.filter((item) => {
|
||||||
const matchesCategory =
|
const matchesCategory = !selectedCatId || (item.category?.id != null && effectiveCategoryIds?.has(item.category.id));
|
||||||
!selectedCatId ||
|
|
||||||
(item.category?.id != null && effectiveCategoryIds?.has(item.category.id));
|
|
||||||
const itemName = item.name ?? item.title;
|
const itemName = item.name ?? item.title;
|
||||||
const matchesSearch =
|
const matchesSearch = !search || itemName.toLowerCase().includes(lowerSearch);
|
||||||
!search || itemName.toLowerCase().includes(lowerSearch);
|
|
||||||
|
|
||||||
// جستجو در عنوان و توضیحات (و در صورت وجود در محتویات)
|
// جستجو در عنوان و توضیحات (و در صورت وجود در محتویات)
|
||||||
const matchesFilterSearch = !filterSearch ||
|
const matchesFilterSearch =
|
||||||
|
!filterSearch ||
|
||||||
(() => {
|
(() => {
|
||||||
const titleMatch = itemName.toLowerCase().includes(lowerFilterQuery);
|
const titleMatch = itemName.toLowerCase().includes(lowerFilterQuery);
|
||||||
const description = item.description || item.desc || "";
|
const description = item.description || item.desc || "";
|
||||||
const descMatch = description.toLowerCase().includes(lowerFilterQuery);
|
const descMatch = description.toLowerCase().includes(lowerFilterQuery);
|
||||||
if (titleMatch || descMatch) return true;
|
if (titleMatch || descMatch) return true;
|
||||||
if (item.content && Array.isArray(item.content) && item.content.length > 0) {
|
if (item.content && Array.isArray(item.content) && item.content.length > 0) {
|
||||||
return item.content.some((content: string) =>
|
return item.content.some((content: string) => content.toLowerCase().includes(lowerFilterQuery));
|
||||||
content.toLowerCase().includes(lowerFilterQuery)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
})();
|
})();
|
||||||
@@ -168,30 +175,22 @@ const MenuIndex = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-4 items-center pt-8 mb-8" ref={wrapperRef}>
|
<div className="flex flex-col gap-2 items-center pt-4 mb-8" ref={wrapperRef}>
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<SearchBox value={search} placeholder={tCommon('SearchPlaceholder')} onChange={updateSearch} />
|
<SearchBox value={search} placeholder={tCommon("SearchPlaceholder")} onChange={updateSearch} />
|
||||||
<CategoryScroll
|
<CategoryScroll categories={categories} selectedCategory={selectedCategory} onSelect={updateCategory} />
|
||||||
categories={categories}
|
|
||||||
selectedCategory={selectedCategory}
|
|
||||||
onSelect={updateCategory}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section className="w-full">
|
<section className="w-full">
|
||||||
<div className="flex gap-2 justify-between items-center relative" ref={smallCategoriesRef}>
|
<div className="flex gap-2 justify-between items-center relative" ref={smallCategoriesRef}>
|
||||||
<span className="sm:text-base text-sm font-medium">
|
<span className="sm:text-base text-sm font-medium">{selectedCategory === "0" ? "" : categories.find((c) => c.id === selectedCategory)?.title || ""}</span>
|
||||||
{selectedCategory === '0' ? '' : categories.find(c => c.id === selectedCategory)?.title || ''}
|
|
||||||
</span>
|
|
||||||
<div className="inline-flex gap-2 justify-end items-center">
|
<div className="inline-flex gap-2 justify-end items-center">
|
||||||
<div className="inline-flex rounded-xl h-8 bg-container p-1">
|
<div className="inline-flex rounded-xl h-8 bg-container p-1">
|
||||||
<button
|
<button
|
||||||
onClick={() => setViewModeAndPersist("list")}
|
onClick={() => setViewModeAndPersist("list")}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"rounded-lg h-6 w-8 inline-flex items-center justify-center transition-colors",
|
"rounded-lg h-6 w-8 inline-flex items-center justify-center transition-colors",
|
||||||
viewMode === "list"
|
viewMode === "list" ? "bg-background text-foreground" : "text-foreground/60 hover:text-foreground",
|
||||||
? "bg-background text-foreground"
|
|
||||||
: "text-foreground/60 hover:text-foreground"
|
|
||||||
)}
|
)}
|
||||||
title="نمایش یک ستونه"
|
title="نمایش یک ستونه"
|
||||||
>
|
>
|
||||||
@@ -201,21 +200,16 @@ const MenuIndex = () => {
|
|||||||
onClick={() => setViewModeAndPersist("grid")}
|
onClick={() => setViewModeAndPersist("grid")}
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"rounded-lg h-6 w-8 inline-flex items-center justify-center transition-colors",
|
"rounded-lg h-6 w-8 inline-flex items-center justify-center transition-colors",
|
||||||
viewMode === "grid"
|
viewMode === "grid" ? "bg-background text-foreground" : "text-foreground/60 hover:text-foreground",
|
||||||
? "bg-background text-foreground"
|
|
||||||
: "text-foreground/60 hover:text-foreground"
|
|
||||||
)}
|
)}
|
||||||
title="نمایش دو ستونه"
|
title="نمایش دو ستونه"
|
||||||
>
|
>
|
||||||
<RowHorizontal color="black" className="w-4 h-4" />
|
<RowHorizontal color="black" className="w-4 h-4" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button onClick={toggleFilterSortModal} className="rounded-xl h-8 bg-container ps-4 pe-2 py-1.5 inline-flex items-center gap-2">
|
||||||
onClick={toggleFilterSortModal}
|
|
||||||
className="rounded-xl h-8 bg-container ps-4 pe-2 py-1.5 inline-flex items-center gap-2"
|
|
||||||
>
|
|
||||||
<TextAlignIcon className="text-foreground" />
|
<TextAlignIcon className="text-foreground" />
|
||||||
<span className="text-xs leading-5 font-medium">{tMenu('MenuFilterDrawer.Label')}</span>
|
<span className="text-xs leading-5 font-medium">{tMenu("MenuFilterDrawer.Label")}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -223,24 +217,15 @@ const MenuIndex = () => {
|
|||||||
<motion.div
|
<motion.div
|
||||||
initial={{ y: smallCategoriesVisible ? 0 : -50, opacity: smallCategoriesVisible ? 1 : 0 }}
|
initial={{ y: smallCategoriesVisible ? 0 : -50, opacity: smallCategoriesVisible ? 1 : 0 }}
|
||||||
animate={{ y: smallCategoriesVisible ? 0 : -50, opacity: smallCategoriesVisible ? 1 : 0 }}
|
animate={{ y: smallCategoriesVisible ? 0 : -50, opacity: smallCategoriesVisible ? 1 : 0 }}
|
||||||
transition={{ duration: .1 }}
|
transition={{ duration: 0.1 }}
|
||||||
className={clsx(
|
className={clsx("fixed left-0 z-10 top-0 px-4 pt-16 bg-[#F4F5F9CC] dark:bg-background/70 backdrop-blur-[44px] right-0 xl:pr-72 xl:pt-20", ``)}
|
||||||
'fixed left-0 z-10 top-0 px-4 pt-16 bg-[#F4F5F9CC] dark:bg-background/70 backdrop-blur-[44px] right-0 xl:pr-72 xl:pt-20',
|
>
|
||||||
``
|
<CategoryScroll categories={categories} selectedCategory={selectedCategory} onSelect={updateCategory} variant="small" />
|
||||||
)}>
|
|
||||||
<CategoryScroll
|
|
||||||
categories={categories}
|
|
||||||
selectedCategory={selectedCategory}
|
|
||||||
onSelect={updateCategory}
|
|
||||||
variant="small"
|
|
||||||
/>
|
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
<VerticalScrollView className="mt-5! overflow-y-auto h-full">
|
<VerticalScrollView className="mt-5! overflow-y-auto h-full">
|
||||||
{filteredReceiptItems.length === 0 ? (
|
{filteredReceiptItems.length === 0 ? (
|
||||||
<div className="text-center text-foreground/60 py-8">
|
<div className="text-center text-foreground/60 py-8">{productsData ? "کالایی یافت نشد" : "در حال بارگذاری..."}</div>
|
||||||
{productsData ? 'کالایی یافت نشد' : 'در حال بارگذاری...'}
|
|
||||||
</div>
|
|
||||||
) : viewMode === "grid" ? (
|
) : viewMode === "grid" ? (
|
||||||
<div className="grid grid-cols-2 gap-3">
|
<div className="grid grid-cols-2 gap-3">
|
||||||
{filteredReceiptItems.map((product) => (
|
{filteredReceiptItems.map((product) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user