'use client'; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { Coins, CreditCard, Gift, TrendingUp } from 'lucide-react'; import { formatRecordTime } from '@/lib/credit-records-store'; type CreditRecord = { id: string; amount: number; description: string; createdAt: string; balanceAfter: number; }; type CreditsTabProps = { creditsBalance: number; creditRecords: CreditRecord[]; }; export default function CreditsTab({ creditsBalance, creditRecords }: CreditsTabProps) { const profile = { credits_balance: creditsBalance }; return (
积分中心 管理你的积分余额与充值

当前余额

{profile.credits_balance} 积分

{[ { amount: 50, price: 9.9, bonus: 5 }, { amount: 200, price: 29.9, bonus: 30 }, { amount: 500, price: 59.9, bonus: 100 }, ].map((pkg) => (

{pkg.amount}

积分

¥{pkg.price}

送{pkg.bonus}积分
))}
积分记录
{creditRecords.length === 0 ? (

暂无积分记录

) : creditRecords.map((tx) => (
0 ? 'bg-emerald-500/10' : 'bg-rose-500/10'}`}> {tx.amount > 0 ? : }

{tx.description}

{formatRecordTime(tx.createdAt)}

0 ? 'text-emerald-500' : 'text-rose-500'}`}> {tx.amount > 0 ? '+' : ''}{tx.amount}

余额 {tx.balanceAfter}

))}
); }