import { useEffect } from 'react'; import { following as $followPageContent } from '../../content'; import { getAvatarSrc } from '../../helpers'; import { useNotif } from '../../contexts/Notification'; import { useUser } from '../../contexts/User'; import ChannelCard from '../../components/ChannelCard'; import GridLayout from '../ChannelDirectory/GridLayout'; import PageLayout from '../ChannelDirectory/PageLayout'; import withVerticalScroller from '../../components/withVerticalScroller'; import useForceLoader from '../../hooks/useForceLoader'; const $followingNotificationsContent = $followPageContent.notification; const Following = () => { const { notifyError } = useNotif(); const { fetchUserFollowingList, hasErrorFetchingFollowingList, userData } = useUser(); const isLoadingForced = useForceLoader(); const { followingList } = userData || {}; const hasFollowingListData = !!followingList?.length; useEffect(() => { if (hasErrorFetchingFollowingList) notifyError($followingNotificationsContent.error.error_loading_channels); }, [hasErrorFetchingFollowingList, notifyError]); return ( {hasFollowingListData && followingList.map((followedChannel) => { const { channelAssetUrls, color, isLive, username } = followedChannel; return ( ); })} ); }; export default withVerticalScroller(Following);