"use client"; import Link from "next/link"; import { formatRingLabel } from "@/lib/forumRings"; import { displayScore, isPinnedThread, isReadOnlyThread, type ForumThread } from "@/lib/forumState"; import { ThreadVoteColumn } from "@/components/forum/ThreadVoteColumn"; export function ForumPostCard({ thread, onVoteChange, }: { thread: ForumThread; /** Fire when vote changes so list meta (score) re-renders from localStorage */ onVoteChange?: () => void; }) { const pinned = isPinnedThread(thread); const locked = isReadOnlyThread(thread.id); const score = displayScore(thread); return (
{formatRingLabel(thread.topicSlug)} · {thread.author || "Anonymous"} · {formatAgo(thread.ts)} · {score} pts
{thread.body}