import Link from "next/link"; import { ArrowUpLeft } from "lucide-react"; import { Placeholder } from "@/components/Placeholder"; import { faDigits, formatPrice } from "@/lib/format"; import type { Product } from "@/lib/data"; import { productHref } from "@/lib/store"; export function ProductCard({ product }: { product: Product }) { const href = product.href ?? productHref(product.id, product.title); return (
{product.discount ? ( {faDigits(product.discount)}٪ ) : null} {product.brand ? (

{product.brand}

) : (

)}

{product.title}

{product.oldPrice ? (

{formatPrice(product.oldPrice)} تومان

) : (

)}

{product.price != null ? ( <> {formatPrice(product.price)} تومان ) : ( تماس بگیرید )}

); }