feat(ui): 升級資產卡片展示,支持累計分紅顯示並修復數據格式化兜底
This commit is contained in:
@@ -67,11 +67,12 @@ export default async function DashboardPage() {
|
||||
const posPnl = new Big(pos.pnlCny);
|
||||
const posPnlPositive = posPnl.gte(0);
|
||||
const formattedPosPnl = formatAmount(pos.pnlCny);
|
||||
const formattedDividends = formatAmount(pos.accumulatedDividendsCny);
|
||||
|
||||
const posPnlNative = new Big(pos.pnlNative);
|
||||
const posPnlNativePositive = posPnlNative.gte(0);
|
||||
|
||||
const avgCostFormatted = !new Big(pos.avgCost).eq(0) && pos.avgCost !== '0' ? formatAmount(pos.avgCost) : '-';
|
||||
const avgCostFormatted = !new Big(pos.avgCost).eq('0') ? formatAmount(pos.avgCost) : '-';
|
||||
const dilutedCostFormatted = !new Big(pos.dilutedCost).eq(0) && pos.dilutedCost !== '0' ? formatAmount(pos.dilutedCost) : '-';
|
||||
|
||||
return (
|
||||
@@ -141,6 +142,12 @@ export default async function DashboardPage() {
|
||||
{posPnlPositive ? '+' : ''}{formattedPosPnl}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex justify-between opacity-50">
|
||||
<span className="text-muted-foreground">累計分紅</span>
|
||||
<span className="font-medium">
|
||||
{formattedDividends}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user