import Link from "next/link";
import { TrendingUp, Calendar, User, FileText, FileClock, FileX, Tag } from "lucide-react";
import { Bill } from "@/lib/types";
import { billLabel, chamberBadgeColor, cn, formatDate, partyBadgeColor, trendColor } from "@/lib/utils";
import { FollowButton } from "./FollowButton";
interface BillCardProps {
bill: Bill;
compact?: boolean;
}
export function BillCard({ bill, compact = false }: BillCardProps) {
const label = billLabel(bill.bill_type, bill.bill_number);
const score = bill.latest_trend?.composite_score;
const tags = bill.latest_brief?.topic_tags?.slice(0, 3) || [];
return (
{label}
{bill.chamber && (
{bill.chamber}
)}
{tags.map((tag) => (
e.stopPropagation()}
className="inline-flex items-center gap-0.5 text-xs px-1.5 py-0.5 rounded-full bg-accent text-accent-foreground hover:bg-accent/70 transition-colors"
>
{tag}
))}
{bill.short_title || bill.title || "Untitled Bill"}
{!compact && bill.sponsor && (
{bill.sponsor.name}
{bill.sponsor.party && (
{bill.sponsor.party}
)}
{bill.sponsor.state && (
{bill.sponsor.state}
)}
)}
{score !== undefined && score > 0 && (
{Math.round(score)}
)}
{bill.latest_brief ? (
Brief
) : bill.has_document ? (
Pending
) : (
No text
)}
{!compact && bill.latest_action_text && (
{formatDate(bill.latest_action_date)} — {bill.latest_action_text}
)}
);
}