"use client"; import { Swiper, SwiperSlide } from "swiper/react"; import { FreeMode } from "swiper/modules"; import "swiper/css"; import "swiper/css/free-mode"; import { SectionTitle } from "@/components/ui/SectionTitle"; import { EmptyState } from "@/components/ui/EmptyState"; import type { Category, StaticImageWithUrl } from "@/lib/meshkee"; function CategorySlotCard({ image }: { image: StaticImageWithUrl }) { const label = image.titleFa ?? image.titleEn ?? ""; const content = (
{/* eslint-disable-next-line @next/next/no-img-element */} {label}
{label && ( {label} )}
); return image.linkUrl ? {content} : content; } export function FeaturedCategories({ categories, images = [], }: { categories: Category[]; images?: StaticImageWithUrl[]; }) { return (
{images.length > 0 ? ( {images.map((image, i) => (
))}
) : categories.length === 0 ? ( ) : ( {categories.map((cat, i) => (
{/* eslint-disable-next-line @next/next/no-img-element */} {cat.name}
{cat.name} {cat.count != null && ( {cat.count} محصول )}
))}
)}
); }