import { motion } from 'framer-motion'; import { MessageCircle, Image as ImageIcon, Pin, Lock } from 'lucide-react'; import { CatalogThread } from '../../types/api'; import { getThumbnailUrl } from '../../utils/apiClient'; import { extractPlainText } from '../../utils/parser'; import { formatNumber } from '../../utils/formatters'; import { getBoardTheme } from '../../lib/design-tokens'; interface ThreadCardProps { thread: CatalogThread; board: string; onClick: () => void; } export default function ThreadCard({ thread, board, onClick }: ThreadCardProps) { const themeColor = getBoardTheme(board); const excerpt = extractPlainText(thread.com, 150); const hasThumbnail = thread.tim && thread.ext; return ( {/* Thumbnail */} {hasThumbnail ? (
{thread.filename {/* Badges */}
{thread.sticky === 1 && (
)} {thread.closed === 1 && (
)}
) : (
)} {/* Content */}
{/* Subject */} {thread.sub && (

{thread.sub}

)} {/* Excerpt */} {excerpt && (

{excerpt}

)} {/* Stats */}
{formatNumber(thread.replies)}
{formatNumber(thread.images)}
{thread.unique_ips && (
👤 {thread.unique_ips}
)}
{/* Limit indicators */} {(thread.bumplimit === 1 || thread.imagelimit === 1) && (
{thread.bumplimit === 1 && ( Bump Limit )} {thread.imagelimit === 1 && ( Image Limit )}
)}
); }