import { useState } from 'react' import Chart from '../Chart' import Select from '../Select' import { useTranslation } from 'next-i18next' export default function StatsAssets({ latestStats, stats }) { const { t } = useTranslation('common') const [selectedAsset, setSelectedAsset] = useState('BTC') const selectedStatsData = stats.filter((stat) => stat.name === selectedAsset) return ( <>
{latestStats.map((stat, index) => (
0 ? 'ml-4 md:ml-2' : null } rounded-md cursor-pointer default-transition ${ selectedAsset === stat.name ? `text-th-primary` : `text-th-fgd-3 hover:text-th-fgd-1` } `} onClick={() => setSelectedAsset(stat.name)} key={stat.name as string} > {stat.name}
))}
{selectedAsset}
x.toLocaleString(undefined, { maximumFractionDigits: 2 }) } type="area" />
`${(x * 100).toFixed(5)}%`} tickFormat={(x) => (x * 100).toLocaleString(undefined, { maximumFractionDigits: 4 }) } type="bar" />
x.toLocaleString(undefined, { maximumFractionDigits: 2 }) } type="area" />
`${(x * 100).toFixed(5)}%`} tickFormat={(x) => (x * 100).toLocaleString(undefined, { maximumFractionDigits: 4 }) } type="bar" />
) }