import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' import { Badge } from '@/components/ui/badge' import type { ListData } from '@/types' interface ListPreviewProps { list: ListData isSubscribed?: boolean } const PURPOSE_LABEL: Record = { 'app.bsky.graph.defs#modlist': 'Moderation List', 'app.bsky.graph.defs#curatelist': 'Curation List', 'app.bsky.graph.defs#referencelist': 'Reference List', } export function ListPreview({ list, isSubscribed }: ListPreviewProps) { const purposeLabel = PURPOSE_LABEL[list.purpose] ?? 'List' return (
{(list.creator.displayName ?? list.creator.handle).charAt(0).toUpperCase()}

{list.name}

by @{list.creator.handle}

{purposeLabel} {isSubscribed && ( Subscribed )}
{list.description && (

{list.description}

)}
{list.memberCount != null && ( {list.memberCount.toLocaleString()} member{list.memberCount !== 1 ? 's' : ''} )} View on Bluesky ↗
) }