papertrail/components/rbac/Pagination.tsx
caelum0x 695a365ae4 feat: PaperTrail — enterprise evidence-verification platform
Multi-tenant platform (182 pages, 228 API routes, ~30 modules) built on a
deterministic verification core: clinical-trial claims checked against
ClinicalTrials.gov registered results and raw event counts (ARR/NNT/RR+CI
recomputed in code, oracle-tested), code-enforced exact-span grounding, and
multi-source cross-verification. Auth/RBAC/multi-tenancy, document processing
at scale (unpdf + Docling), agentic workflows, Claude Science connector,
compliance/audit, billing, public API, and more.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 07:21:22 +03:00

48 lines
1.2 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client";
// Shared pagination control for RBAC list views. Renders nothing when there is
// only a single page of results.
export function Pagination({
page,
total,
limit,
onPageChange,
}: {
page: number;
total: number;
limit: number;
onPageChange: (page: number) => void;
}) {
const pageCount = Math.max(1, Math.ceil(total / limit));
if (pageCount <= 1) return null;
const from = (page - 1) * limit + 1;
const to = Math.min(page * limit, total);
return (
<div className="mt-4 flex items-center justify-between text-sm text-ink/60">
<span>
{from}–{to} of {total}
</span>
<div className="flex gap-2">
<button
type="button"
onClick={() => onPageChange(page - 1)}
disabled={page <= 1}
className="rounded-md border border-ink/15 bg-white px-3 py-1.5 disabled:opacity-40"
>
Previous
</button>
<button
type="button"
onClick={() => onPageChange(page + 1)}
disabled={page >= pageCount}
className="rounded-md border border-ink/15 bg-white px-3 py-1.5 disabled:opacity-40"
>
Next
</button>
</div>
</div>
);
}