"use client"; import { use } from "react"; import { useQuery } from "@tanstack/react-query"; import Link from "next/link"; import { Landmark } from "lucide-react"; import { shareAPI } from "@/lib/api"; import type { Bill } from "@/lib/types"; import { billLabel, formatDate } from "@/lib/utils"; export default function SharedCollectionPage({ params }: { params: Promise<{ token: string }> }) { const { token } = use(params); const { data: collection, isLoading, isError } = useQuery({ queryKey: ["share-collection", token], queryFn: () => shareAPI.getCollection(token), retry: false, }); return (
Collection not found or link is invalid.
{collection.bill_count} {collection.bill_count === 1 ? "bill" : "bills"}
No bills in this collection.
) : (Latest action: {formatDate(bill.latest_action_date)}
)} ))}