/** * # 组件 产品卡片 ProductCard(Tailwind + shadcn/ui 实现) * 产品网格卡片:图 / 标题 / Read more 链接。首页、列表页、搜索页复用。 * 整卡为链接,文字继承品牌橙(与原 .card 于 a 上同色一致)。 */ import { Link } from "@tanstack/react-router"; import { useT } from "~/i18n"; /** # 类型 产品卡片数据(listProducts.items 元素子集) */ export type ProductCardData = { id: number; slug: string; title: string; sku: string | null; imageUrl: string | null; imageAlt?: string | null; }; /** # 组件 产品卡片 */ export function ProductCard({ p }: { p: ProductCardData }) { const t = useT(); return (
{p.imageUrl ? {p.imageAlt : null}
{p.title}
{t("card_read_more")}
); }