import React from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { useAccountLookup, useFollowers } from 'soapbox/api/hooks'; import Account from 'soapbox/components/account'; import MissingIndicator from 'soapbox/components/missing-indicator'; import ScrollableList from 'soapbox/components/scrollable-list'; import { Column, Spinner } from 'soapbox/components/ui'; const messages = defineMessages({ heading: { id: 'column.followers', defaultMessage: 'Followers' }, }); interface IFollowers { params?: { username?: string } } /** Displays a list of accounts who follow the given account. */ const Followers: React.FC = ({ params }) => { const intl = useIntl(); const { account, isUnavailable } = useAccountLookup(params?.username); const { accounts, hasNextPage, fetchNextPage, isLoading, } = useFollowers(account?.id); if (isLoading) { return ( ); } if (!account) { return ( ); } if (isUnavailable) { return (
); } return ( } itemClassName='pb-4' > {accounts.map((account) => , )} ); }; export default Followers;