// @flow import React, { Fragment } from 'react'; import ClaimList from 'component/claimList'; import HiddenNsfwClaims from 'component/hiddenNsfwClaims'; import { withRouter } from 'react-router-dom'; import Paginate from 'component/common/paginate'; import Spinner from 'component/spinner'; import Button from 'component/button'; type Props = { uri: string, totalPages: number, fetching: boolean, params: { page: number }, claimsInChannel: Array, channelIsBlocked: boolean, channelIsMine: boolean, fetchClaims: (string, number) => void, channelIsBlackListed: boolean, }; function ChannelContent(props: Props) { const { uri, fetching, claimsInChannel, totalPages, channelIsMine, channelIsBlocked, fetchClaims, channelIsBlackListed, } = props; const hasContent = Boolean(claimsInChannel && claimsInChannel.length); return ( {fetching && !hasContent && (
)} {!fetching && !hasContent && !channelIsBlocked && !channelIsBlackListed && (

{__("This channel hasn't uploaded anything.")}

)} {!fetching && channelIsBlackListed && (

{__( 'In response to a complaint we received under the US Digital Millennium Copyright Act, we have blocked access to this channel from our applications.' )}

)} {!fetching && channelIsBlocked && (

{__('You have blocked this channel content.')}

)} {!channelIsMine && } {hasContent && !channelIsBlocked && !channelIsBlackListed && ( claim && claim.canonical_url)} /> )} {!channelIsBlocked && !channelIsBlackListed && ( fetchClaims(uri, page)} totalPages={totalPages} loading={fetching && !hasContent} /> )}
); } export default withRouter(ChannelContent);