import Link from "next/link"; export function Pager({ basePath, cursor, nextCursor, extra = {}, }: { basePath: string; cursor?: string; nextCursor?: string | null; extra?: Record; }) { const make = (c?: string) => { const sp = new URLSearchParams(); for (const [k, v] of Object.entries(extra)) if (v) sp.set(k, v); if (c) sp.set("cursor", c); const qs = sp.toString(); return qs ? `${basePath}?${qs}` : basePath; }; return (
{cursor ? `cursor: ${cursor.slice(0, 12)}…` : ""} {nextCursor ? ( next → ) : ( end )}
); }