import Image from "next/image"; import Link from "next/link"; import { ArrowLeft } from "lucide-react"; import { productImage, productUrl, slugifyFa, type Product, } from "@/lib/meshkee"; export function ApiProductCard({ product, headingLevel = 2, }: { product: Product; headingLevel?: 2 | 3; }) { const title = product.nameFa || product.title; const href = productUrl(product); const Heading = headingLevel === 3 ? "h3" : "h2"; const categoryTitle = product.categoryNameFa || product.categoryName || "آینه هوشمند"; const categoryHref = product.categoryId ? `/products/category/${product.categoryId}/${slugifyFa(categoryTitle)}` : null; return (
{title}
{categoryHref ? {categoryTitle} : categoryTitle} {title}

{product.store?.inStock ? "موجود" : "برای سفارش تماس بگیرید"}

جزئیات
); }