import classNames from 'clsx'; import React from 'react'; import { FormattedMessage } from 'react-intl'; import { getSettings } from 'soapbox/actions/settings'; import Badge from 'soapbox/components/badge'; import RelativeTimestamp from 'soapbox/components/relative-timestamp'; import { Stack, Text } from 'soapbox/components/ui'; import AccountContainer from 'soapbox/containers/account-container'; import ActionButton from 'soapbox/features/ui/components/action-button'; import { useAppSelector } from 'soapbox/hooks'; import { makeGetAccount } from 'soapbox/selectors'; import { shortNumberFormat } from 'soapbox/utils/numbers'; const getAccount = makeGetAccount(); interface IAccountCard { id: string, } const AccountCard: React.FC = ({ id }) => { const me = useAppSelector((state) => state.me); const account = useAppSelector((state) => getAccount(state, id)); const autoPlayGif = useAppSelector((state) => getSettings(state).get('autoPlayGif')); if (!account) return null; const followedBy = me !== account.id && account.relationship?.followed_by; return (
{followedBy && (
} />
)}
{shortNumberFormat(account.statuses_count)} {shortNumberFormat(account.followers_count)} {account.last_status_at === null ? ( ) : ( )}
); }; export default AccountCard;