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