import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { Link } from 'react-router-dom'; import VerificationBadge from 'soapbox/components/verification-badge'; import { useAccount, useAppSelector } from 'soapbox/hooks'; import { Card, CardBody, CardTitle, HStack, Stack, Text } from '../../components/ui'; import ActionButton from '../ui/components/action-button'; import type { Account } from 'soapbox/types/entities'; const messages = defineMessages({ heading: { id: 'feed_suggestions.heading', defaultMessage: 'Suggested Profiles' }, viewAll: { id: 'feed_suggestions.view_all', defaultMessage: 'View all' }, }); const SuggestionItem = ({ accountId }: { accountId: string }) => { const account = useAccount(accountId) as Account; return ( {account.acct} {account.verified && } @{account.acct}
); }; const FeedSuggestions = () => { const intl = useIntl(); const suggestedProfiles = useAppSelector((state) => state.suggestions.items); const isLoading = useAppSelector((state) => state.suggestions.isLoading); if (!isLoading && suggestedProfiles.size === 0) return null; return ( {intl.formatMessage(messages.viewAll)} {suggestedProfiles.slice(0, 4).map((suggestedProfile) => ( ))} ); }; export default FeedSuggestions;