"use client";
interface Asset {
symbol: string;
value: number;
color: string;
}
interface AssetDistributionProps {
assets: Asset[];
totalValue: number;
}
export function AssetDistribution({ assets, totalValue }: AssetDistributionProps) {
const sortedAssets = [...assets].sort((a, b) => b.value - a.value);
const total = assets.reduce((sum, asset) => sum + asset.value, 0);
return (
Asset Distribution
${totalValue.toLocaleString()}
Total Value
{sortedAssets.map((asset) => (
${asset.value.toLocaleString()}
{((asset.value / total) * 100).toFixed(1)}%
))}
);
}