import { useState } from "react" import { RiCheckboxCircleFill } from "react-icons/ri" import { IoAdd } from "react-icons/io5" import { cn } from "@/lib/utils/cn" import { ChannelInfo } from "@/types/general" import { isCertifiedUser } from "@/app/certification" import { DefaultAvatar } from "../default-avatar" import { formatLargeNumber } from "@/lib/formatters/formatLargeNumber" export function ChannelCard({ channel, onClick, className = "", }: { channel: ChannelInfo onClick?: (channel: ChannelInfo) => void className?: string }) { const [channelThumbnail, setChannelThumbnail] = useState(channel.thumbnail) const handleBadChannelThumbnail = () => { try { if (channelThumbnail) { setChannelThumbnail("") } } catch (err) { } } const isCreateButton = !channel.id return ( //