import { PieChart, Pie, Cell, Tooltip } from 'recharts' import { formatUsdValue, tokenPrecision } from 'utils' import * as MonoIcons from '../icons' import { QuestionMarkCircleIcon } from '@heroicons/react/solid' import { useTheme } from 'next-themes' export const CHART_COLORS = (theme) => { return { All: '#ff7c43', spacer: theme === 'Light' ? 'rgba(0,0,0,0.1)' : 'rgba(255,255,255,0.1)', ADA: '#404C5E', AVAX: '#E84142', BNB: '#F3BA2F', BTC: '#F7931A', ETH: '#627EEA', FTT: '#02A6C2', GMT: '#CBA74A', MNGO: '#FBB31F', MSOL: '#C8ECE1', RAY: '#4CA2DA', SOL: '#916CE0', SRM: '#58D4E3', USDC: '#2775CA', USDT: '#50AF95', } } const LongShortChart = ({ chartData }: { chartData: any[] }) => { const { theme } = useTheme() const CustomToolTip = () => { const renderIcon = (symbol) => { const iconName = `${symbol.slice(0, 1)}${symbol .slice(1, 4) .toLowerCase()}MonoIcon` const SymbolIcon = MonoIcons[iconName] || QuestionMarkCircleIcon return (
{asset}
{amount.toLocaleString(undefined, { maximumFractionDigits: tokenPrecision[symbol], })}
{formatUsdValue(value)}