/** * TopicCard - Displays a single topic in a list view. * Shows title, author, category, reply/reaction counts, last activity. * @see specs/prd-web.md Section 4 (Topic Components) */ import Link from 'next/link' import Image from 'next/image' import { ChatCircle, Heart, Clock, PushPin } from '@phosphor-icons/react/dist/ssr' import type { Topic } from '@/lib/api/types' import { cn } from '@/lib/utils' import { formatRelativeTime, getTopicUrl } from '@/lib/format' interface TopicCardProps { topic: Topic className?: string } export function TopicCard({ topic, className }: TopicCardProps) { const topicUrl = getTopicUrl({ authorHandle: topic.author?.handle ?? topic.authorDid, rkey: topic.rkey, }) return (
{/* Content */}
{/* Title */}

{topic.isPinned && ( )} {topic.title} {topic.pinnedScope === 'forum' && ( Global )}

{/* Metadata */}
{/* Author */} {topic.author?.avatarUrl ? ( ) : ( )} {topic.author?.displayName ?? topic.author?.handle ?? topic.authorDid} {/* Category */} {topic.category} {/* Tags */} {topic.tags?.map((tag) => ( #{tag} ))}
{/* Stats */}
) }