import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { getPortfolioPositions } from '@/actions/portfolio'; import { formatQuantity } from '@/lib/formatters'; import AllocationChart from '@/components/dashboard/allocation-chart'; const CHART_COLORS = [ '#3b82f6', '#8b5cf6', '#10b981', '#f59e0b', '#ef4444', '#06b6d4', ]; export default async function DashboardPage() { const positions = await getPortfolioPositions(); const chartData = positions.map((pos, index) => ({ name: pos.symbol, value: Number(pos.quantity), fill: CHART_COLORS[index % CHART_COLORS.length], })); return (

欢迎来到 Omniledger

您的跨界记账中枢。

{positions.length === 0 ? (

暂无持仓,请先添加资产和交易记录。

) : ( positions.map((pos) => ( {pos.symbol} {pos.type}
持仓数量 {formatQuantity(pos.quantity, pos.type)}
结算币种 {pos.baseCurrency}
)) )}
资产分布
); }