import React from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { useAccountLookup, useFollowing } 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.following', defaultMessage: 'Following' }, }); interface IFollowing { params?: { username?: string } } /** Displays a list of accounts the given user is following. */ const Following: React.FC = ({ params }) => { const intl = useIntl(); const { account, isUnavailable } = useAccountLookup(params?.username); const { accounts, hasNextPage, fetchNextPage, isLoading, } = useFollowing(account?.id); if (isLoading) { return ( ); } if (!account) { return ( ); } if (isUnavailable) { return (
); } return ( } itemClassName='pb-4' > {accounts.map((account) => ( ))} ); }; export default Following;