"use client"; import { useState } from "react"; import { Search, Filter } from "lucide-react"; import { useBills } from "@/lib/hooks/useBills"; import { BillCard } from "@/components/shared/BillCard"; const CHAMBERS = ["", "House", "Senate"]; const TOPICS = [ "", "healthcare", "taxation", "defense", "education", "immigration", "environment", "housing", "infrastructure", "technology", "agriculture", "judiciary", "foreign-policy", "veterans", "social-security", "trade", "budget", "energy", "banking", "transportation", "labor", ]; export default function BillsPage() { const [q, setQ] = useState(""); const [chamber, setChamber] = useState(""); const [topic, setTopic] = useState(""); const [page, setPage] = useState(1); const params = { ...(q && { q }), ...(chamber && { chamber }), ...(topic && { topic }), page, per_page: 20, sort: "latest_action_date", }; const { data, isLoading } = useBills(params); return (

Bills

Browse and search US Congressional legislation

{/* Filters */}
{ setQ(e.target.value.trim()); setPage(1); }} className="w-full pl-9 pr-3 py-2 text-sm bg-card border border-border rounded-md focus:outline-none focus:ring-1 focus:ring-primary" />
{/* Results */} {isLoading ? (
Loading bills...
) : ( <>
{data?.total ?? 0} bills found Page {data?.page} of {data?.pages}
{data?.items?.map((bill) => ( ))}
{/* Pagination */} {data && data.pages > 1 && (
)} )}
); }