import { Placeholder } from "./Placeholder"; import { formatPrice } from "@/data/sample"; type ProductCardProps = { name: string; brand: string; price: number | null; oldPrice?: number | null; discount?: number; image: string; variant?: "sale" | "default" | "brand"; href?: string; fluid?: boolean; contactPhone?: string; }; export function ProductCard({ name, brand, price, oldPrice, discount, image, variant = "default", href, fluid = false, contactPhone, }: ProductCardProps) { const info = ( <>
{variant === "brand" && ( {brand} )}

{brand}

{name}

{oldPrice != null && (
{formatPrice(oldPrice)} {discount != null && ( {discount}٪ )}
)}
{price != null ? ( <> {formatPrice(price)} تومان ) : ( تماس با فروشگاه )}
); return (
{href ? ( {info} ) : (
{info}
)}
{price != null ? ( ) : contactPhone ? ( 📞 تماس با فروشگاه ) : ( )}
); }