import moment from 'moment' import { Area, AreaChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis, } from 'recharts' import { formatValue } from 'utils/formatters' import { FormattedNumber } from 'components/FormattedNumber' import { Text } from 'components/Text' import { useAccountStats } from 'hooks/data/useAccountStats' import useStore from 'store' export const RiskChart = ({ data }: RiskChartProps) => { const enableAnimations = useStore((s) => s.enableAnimations) const accountStats = useAccountStats() const currentRisk = accountStats?.risk ?? 0 return (
{ return moment(value).format('DD') }} fontSize={10.53} dataKey='date' /> { if (payload && payload.length) { const risk = Number(payload[0].value) ?? 0 return (
{moment(label).format('MM-DD-YYYY')} Risk: {formatValue(risk, { minDecimals: 0, maxDecimals: 0, suffix: '%' })}
) } }} />
) }