// @flow import * as PAGES from 'constants/pages'; import * as ICONS from 'constants/icons'; import React from 'react'; import ClaimListDiscover from 'component/claimListDiscover'; import ClaimList from 'component/claimList'; import Page from 'component/page'; import Button from 'component/button'; import Icon from 'component/common/icon'; import { TYPE_NEW } from 'component/claimListDiscover/view'; type Props = { email: string, subscribedChannels: Array, doFetchRecommendedSubscriptions: () => void, suggestedSubscriptions: Array<{ uri: string }>, }; function ChannelsFollowing(props: Props) { const { subscribedChannels, suggestedSubscriptions, doFetchRecommendedSubscriptions } = props; const hasSubsribedChannels = subscribedChannels.length > 0; const [showTab, setShowTab] = React.useState(!hasSubsribedChannels); React.useEffect(() => { if (!hasSubsribedChannels) { doFetchRecommendedSubscriptions(); } }, [doFetchRecommendedSubscriptions, hasSubsribedChannels]); return ( {showTab ? ( setShowTab(false)} /> } uris={suggestedSubscriptions.map(sub => `lbry://${sub.uri}`)} /> ) : ( {__('Following')} } defaultTypeSort={TYPE_NEW} channelIds={subscribedChannels.map(sub => sub.uri.split('#')[1])} meta={