// @flow 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'; type Props = { channels: Array, fetchChannelListMine: () => void, fetchingChannels: boolean, youtubeChannels: ?Array, }; export default function ChannelsPage(props: Props) { const { channels, fetchChannelListMine, fetchingChannels, youtubeChannels } = props; const hasYoutubeChannels = youtubeChannels && Boolean(youtubeChannels.length); const hasPendingChannels = channels && channels.some(channel => channel.confirmations === -1); useEffect(() => { fetchChannelListMine(); let interval; if (hasPendingChannels) { interval = setInterval(() => { fetchChannelListMine(); }, 5000); } return () => { clearInterval(interval); }; }, [fetchChannelListMine, hasPendingChannels]); return ( {hasYoutubeChannels && } {channels && channels.length ? (
channel.permanent_url)} />
) : (

{__('No Channels Created Yet')}

)}
); }