"use client"; import { useState } from "react"; import { useSearchParams } from "next/navigation"; import { Search } 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 searchParams = useSearchParams(); const [q, setQ] = useState(searchParams.get("q") ?? ""); const [chamber, setChamber] = useState(searchParams.get("chamber") ?? ""); const [topic, setTopic] = useState(searchParams.get("topic") ?? ""); 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 (
Browse and search US Congressional legislation