import { useEffect } from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; import { useDispatch } from 'react-redux'; import { fetchSuggestions } from 'flavours/glitch/actions/suggestions'; import { markAsPartial } from 'flavours/glitch/actions/timelines'; import { ColumnBackButton } from 'flavours/glitch/components/column_back_button'; import { EmptyAccount } from 'flavours/glitch/components/empty_account'; import Account from 'flavours/glitch/containers/account_container'; import { useAppSelector } from 'flavours/glitch/store'; export const Follows = () => { const dispatch = useDispatch(); const isLoading = useAppSelector(state => state.getIn(['suggestions', 'isLoading'])); const suggestions = useAppSelector(state => state.getIn(['suggestions', 'items'])); useEffect(() => { dispatch(fetchSuggestions(true)); return () => { dispatch(markAsPartial('home')); }; }, [dispatch]); let loadedContent; if (isLoading) { loadedContent = (new Array(8)).fill().map((_, i) => ); } else if (suggestions.isEmpty()) { loadedContent =
; } else { loadedContent = suggestions.map(suggestion => ); } return ( <>

{loadedContent}

{chunks} }} />

); };