import React from "react"; import type { Product } from "../types"; function Tag({ tag }: { tag: Product["tag"] }) { if (!tag || tag === "none") return null; const map: Record = { new: "bg-emerald-500", hot: "bg-rose-500", sale: "bg-amber-500", }; const cls = map[tag] ?? "bg-gray-500"; return {tag.toUpperCase()}; } export function ProductCard({ item, basePath = "" }: { item: Product; basePath?: string }) { return (
{item.name}
{item.name}
{item.description &&
{item.description}
} {item.price != null && (
¥{item.price}
)}
); }