import React from 'react' import { useChannel } from '@/api/hooks' import { useChannelVideoCount } from '@/api/hooks/channel' import { absoluteRoutes } from '@/config/routes' import { AssetType, useAsset } from '@/providers' import { ChannelCardBase } from '@/shared/components' type ChannelCardProps = { id?: string className?: string onClick?: (e: React.MouseEvent) => void } export const ChannelCard: React.FC = ({ id, className, onClick }) => { const { channel, loading } = useChannel(id ?? '', { fetchPolicy: 'cache-first', skip: !id }) const { url } = useAsset({ entity: channel, assetType: AssetType.AVATAR }) const { videoCount } = useChannelVideoCount(id ?? '', undefined, { fetchPolicy: 'cache-first', skip: !id, }) const isLoading = loading || id === undefined return ( ) }