// @flow import * as ICONS from 'constants/icons'; import React, { useEffect } from 'react'; import ClaimList from 'component/claimList'; import Page from 'component/page'; import Button from 'component/button'; import YoutubeTransferStatus from 'component/youtubeTransferStatus'; import Spinner from 'component/spinner'; import Yrbl from 'component/yrbl'; import * as PAGES from 'constants/pages'; type Props = { channels: Array, channelUrls: Array, fetchChannelListMine: () => void, fetchingChannels: boolean, youtubeChannels: ?Array, }; export default function ChannelsPage(props: Props) { const { channels, channelUrls, fetchChannelListMine, fetchingChannels, youtubeChannels } = props; const hasYoutubeChannels = youtubeChannels && Boolean(youtubeChannels.length); const hasPendingChannels = channels && channels.some(channel => channel.confirmations < 0); useEffect(() => { fetchChannelListMine(); }, [fetchChannelListMine, hasPendingChannels]); return (
{hasYoutubeChannels && } {channelUrls && Boolean(channelUrls.length) && ( {__('Your channels')}} headerAltControls={
{!(channelUrls && channelUrls.length) && ( {!fetchingChannels ? (
) : (
)}
)}
); }