import React from 'react'; import { useIntl, defineMessages } from 'react-intl'; import { NavLink } from 'react-router-dom'; import { HStack, Text } from 'soapbox/components/ui'; import { shortNumberFormat } from 'soapbox/utils/numbers'; import type { Account } from 'soapbox/types/entities'; const messages = defineMessages({ followers: { id: 'account.followers', defaultMessage: 'Followers' }, follows: { id: 'account.follows', defaultMessage: 'Follows' }, }); interface IProfileStats { account: Account | undefined onClickHandler?: React.MouseEventHandler } /** Display follower and following counts for an account. */ const ProfileStats: React.FC = ({ account, onClickHandler }) => { const intl = useIntl(); if (!account) { return null; } return ( {shortNumberFormat(account.followers_count)} {intl.formatMessage(messages.followers)} {shortNumberFormat(account.following_count)} {intl.formatMessage(messages.follows)} ); }; export default ProfileStats;