fix(ui): 转换 Big 对象为原生数字修复服务端序列化报错,并补充 Fragment key 修复列表渲染警告
This commit is contained in:
parent
eaeb143190
commit
a408cad494
@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useState, useEffect, useTransition } from 'react';
|
||||
import React, { useState, useEffect, useTransition } from 'react';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import {
|
||||
Table,
|
||||
@ -214,8 +214,8 @@ export default function DashboardPage() {
|
||||
const isExpanded = !!expandedIds[pos.assetId];
|
||||
|
||||
return (
|
||||
<>
|
||||
<TableRow key={pos.assetId} className="cursor-pointer" onClick={() => toggleExpand(pos.assetId)}>
|
||||
<React.Fragment key={pos.assetId}>
|
||||
<TableRow className="cursor-pointer" onClick={() => toggleExpand(pos.assetId)}>
|
||||
<TableCell>
|
||||
<div className="flex flex-col">
|
||||
<span className="font-semibold">{pos.name || pos.symbol}</span>
|
||||
@ -361,7 +361,7 @@ export default function DashboardPage() {
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)}
|
||||
</>
|
||||
</React.Fragment>
|
||||
);
|
||||
})}
|
||||
</TableBody>
|
||||
|
||||
@ -432,7 +432,7 @@ export async function getPortfolioSummary() {
|
||||
|
||||
const chartData = positions.map((pos, index) => ({
|
||||
name: pos.symbol,
|
||||
value: new Big(pos.cnyValue),
|
||||
value: new Big(pos.cnyValue).toNumber(),
|
||||
fill: [
|
||||
'#3b82f6',
|
||||
'#8b5cf6',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user