"use client"; import Image from "next/image"; interface CartProductProps { image: string; imageAlt?: string; productName: string; price: number | string; description: string; onBuy?: () => void; } /** * Product card — fills the parent grid cell width (w-full). * * Layout (top → bottom): * 1. Image area (fixed height h-36) with coffee-mug fallback icon * 2. Name + description (flex-1, grows to fill space) * 3. Price + Buy button row (pinned to bottom) * * Responsive: card width is controlled by the parent grid, not the card itself. */ export default function CartProduct({ image, imageAlt = "Ảnh sản phẩm", productName, price, description, onBuy, }: CartProductProps) { const formattedPrice = typeof price === "number" ? price.toLocaleString("vi-VN", { style: "currency", currency: "VND" }) : price; return (
{description}