fix(ui): 增加 txTypeMap,实现交易流水类型中文化
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user