import React from "react"; import CardMedia from "component/cardMedia"; import { TruncatedText, BusyMessage } from "component/common.js"; class ChannelTile extends React.PureComponent { componentDidMount() { const { uri, resolveUri } = this.props; resolveUri(uri); } componentWillReceiveProps(nextProps) { const { uri, resolveUri } = this.props; if (nextProps.uri != uri) { resolveUri(uri); } } render() { const { claim, navigate, isResolvingUri, totalItems, uri } = this.props; let channelName, channelId; if (claim) { channelName = claim.name; channelId = claim.claim_id; } let onClick = () => navigate("/show", { uri }); return (
{channelName && }

{channelName || uri}

{isResolvingUri && } {totalItems > 0 && This is a channel with {totalItems}{" "} {totalItems === 1 ? " item" : " items"} inside of it. } {!isResolvingUri && !totalItems && This is an empty channel.}
); } } export default ChannelTile;