"use client"; import { useCallback, useState } from "react"; import { api, type AdminCollection } from "@/lib/api"; import { usePagedList } from "@/lib/use-paged-list"; import { ListShell, EmptyRow } from "@/components/list-shell"; import { Table, THead, TR, TH, TD } from "@/components/ui/table"; import { fmtDate } from "@/lib/utils"; import { Clamp } from "@/components/ui/clamp"; export default function CollectionsPage() { const [q, setQ] = useState(""); const fetcher = useCallback( (limit: number, offset: number) => api.collections(q, limit, offset), [q], ); const list = usePagedList(fetcher, [q]); return ( {list.items.length === 0 && !list.loading ? ( ) : ( list.items.map((c) => ( )) )}
Collection Owner Items Visibility Created
{c.title} {c.description ? ( {c.description} ) : null} {c.owner_name} {`@${c.owner_handle}`} {c.item_count} {c.is_public ? "Public" : "Private"} {fmtDate(c.created_at)}
); }