import { AspectRatio } from "@/components/ui/aspect-ratio"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { cn } from "@/lib/utils"; interface Product { name: string; image: { src: string; alt: string; }; link: string; price: ProductPrice; collection: string; } type ProductCardProps = Product; interface ProductPrice { regular: number; sale?: number; currency: string; } type ProductList = Array; const PRODUCTS_LIST: ProductList = [ { collection: "ساعت طلایی", name: "گوشواره بلوم و گلیم", link: "#", image: { src: "/block-media/shadcnblocks/block/ecommerce/accessories/Elegant-Floral-Earrings-1.png", alt: "گوشواره گل‌دار ظریف", }, price: { regular: 4000000.0, currency: "ریال", }, }, { collection: "ساعت طلایی", name: "گوشواره درخشش عاشقانه", link: "#", image: { src: "/block-media/shadcnblocks/block/ecommerce/accessories/Gold-Heart-Earrings-1.png", alt: "گوشواره طلایی قلبی", }, price: { regular: 8000000.0, sale: 7599000.0, currency: "ریال", }, }, { collection: "ساعت طلایی", name: "گوشواره زمزمه طلایی", link: "#", image: { src: "/block-media/shadcnblocks/block/ecommerce/accessories/Gold-Hoop-Earrings-on-Ceramic-Dish-1.png", alt: "گوشواره حلقه‌ای طلایی", }, price: { regular: 6000000.0, currency: "ریال", }, }, ]; interface ProductList5Props { className?: string; } const ProductList5 = ({ className }: ProductList5Props) => { return (

جایی که ظرافت، همراه هر روز است.

محبوب‌ترین‌های مشتریان

{PRODUCTS_LIST.map((item, index) => ( ))}
); }; const ProductCard = ({ name, link, image, price, collection, }: ProductCardProps) => { const { regular, sale, currency } = price; return ( {image.alt}

{collection}

{name}
); }; const formatCurrency = ( value: number, currency: string = "ریال", locale: string = "fa-IR", ) => { return `${value.toLocaleString(locale)} ${currency}`; }; const ProductCardPrice = ({ regular, sale, currency, }: { regular: number; sale?: number; currency: string; }) => { const onSale = sale != null; return (
{formatCurrency(regular, currency)} {onSale ? ( {formatCurrency(sale, currency)} ) : null}
); }; export { ProductList5 };