Align Sidebar & BottomNav menus, remove "Search", add user profile mock data, implement /api/users, add FilterDrawer, complete Section, ProfileHeader, MetricsRFM components Co-authored-by: null <4804959+fnvtk@users.noreply.github.com>
23 lines
846 B
TypeScript
23 lines
846 B
TypeScript
"use client"
|
|
|
|
export type Purchase = { id: string; amount: number; time: string; item: string }
|
|
|
|
export default function PurchaseHistory({ items }: { items: Purchase[] }) {
|
|
if (!items?.length) return <div className="text-sm text-muted-foreground">暂无购买记录</div>
|
|
return (
|
|
<div className="grid gap-2">
|
|
{items.map((o) => (
|
|
<div key={o.id} className="flex items-center justify-between rounded-lg border p-3 bg-white">
|
|
<div className="min-w-0">
|
|
<div className="text-sm font-medium truncate">{o.item}</div>
|
|
<div className="text-xs text-muted-foreground">
|
|
{new Date(o.time).toLocaleDateString("zh-CN")}
|
|
</div>
|
|
</div>
|
|
<div className="text-sm font-semibold">¥{o.amount.toLocaleString("zh-CN")}</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
)
|
|
}
|