import React from 'react' import { RouteComponentProps, useParams } from '@reach/router' import { useQuery } from '@apollo/client' import { GET_CHANNEL } from '@/api/queries/channels' import { GetChannel, GetChannelVariables } from '@/api/queries/__generated__/GetChannel' import { VideoGrid } from '@/components' import { Header, StyledAvatar, Title, TitleSection, VideoSection } from './ChannelView.style' const ChannelView: React.FC = () => { const { id } = useParams() const { loading, data } = useQuery(GET_CHANNEL, { variables: { id }, }) if (loading || !data?.channel) { return

Loading Channel...

} const videos = data?.channel?.videos || [] return (
{data.channel.handle}
{videos.length > 0 && ( )}
) } export default ChannelView