import { useNavigate } from "@tanstack/react-router"; import { formatPrice } from "../lib/formatters"; interface ThreadCardProps { id: number; name: string; candidateCount: number; minPriceCents: number | null; maxPriceCents: number | null; createdAt: string; status: "active" | "resolved"; } function formatDate(iso: string): string { const d = new Date(iso); return d.toLocaleDateString("en-US", { month: "short", day: "numeric" }); } function formatPriceRange( min: number | null, max: number | null, ): string | null { if (min == null && max == null) return null; if (min === max) return formatPrice(min); return `${formatPrice(min)} - ${formatPrice(max)}`; } export function ThreadCard({ id, name, candidateCount, minPriceCents, maxPriceCents, createdAt, status, }: ThreadCardProps) { const navigate = useNavigate(); const isResolved = status === "resolved"; const priceRange = formatPriceRange(minPriceCents, maxPriceCents); return ( ); }