import { FormattedMessage, FormattedNumber } from 'react-intl'; import { Sparklines, SparklinesCurve } from 'react-sparklines'; import { ShortNumber } from 'mastodon/components/short_number'; import type { TimeSeriesMonth } from 'mastodon/models/annual_report'; export const Followers: React.FC<{ data: TimeSeriesMonth[]; total?: number; }> = ({ data, total }) => { const change = data.reduce((sum, item) => sum + item.followers, 0); const cumulativeGraph = data.reduce( (newData, item) => [ ...newData, item.followers + (newData[newData.length - 1] ?? 0), ], [0], ); return (
{change > -1 ? '+' : '-'}
}} />
); };