fix(ui): 增加 txTypeMap,实现交易流水类型中文化

This commit is contained in:
2026-04-29 00:51:50 +08:00
parent ffeac757e3
commit fd529404bc
2 changed files with 12 additions and 1 deletions
+8 -1
View File
@@ -31,6 +31,13 @@ import { deleteTransaction } from '@/actions/transaction';
import { ChevronDown, ChevronUp, Plus, Edit3, Trash2 } from 'lucide-react';
import Big from 'big.js';
const txTypeMap: Record<string, string> = {
BUY: '买入',
SELL: '卖出',
DIVIDEND: '分红',
AIRDROP: '空投',
};
function getCurrencySymbol(currency: string): string {
if (currency === 'USD') return '$';
if (currency === 'HKD') return 'HK$';
@@ -303,7 +310,7 @@ export default function DashboardPage() {
tx.txType === 'AIRDROP' ? 'bg-purple-100 text-purple-700' :
'bg-gray-100 text-gray-700'
}`}>
{tx.txType}
{txTypeMap[tx.txType] || tx.txType}
</span>
</TableCell>
<TableCell className="text-right text-xs">