Skip to documentation
Design system / Sources & standards
Current repository source
member-pagination.tsx
src/components/members/member-pagination.tsx
This view contains the escaped source read during the deployment build. Code and policy text are unchanged. Markdown is shown as source, not rendered as a document. A new deployment refreshes the content.
import { Button } from "@/components/ui/button";
import { Pagination, PaginationContent, PaginationItem } from "@/components/ui/pagination";
import { Text } from "@/components/ui/text";
import { MEMBER_PAGE_SIZE } from "./member-directory-model";
/** Local paging uses buttons, not navigation links with pretend URLs. */
export function MemberPagination({ page, pageCount, resultCount, total, onPage }: {
page: number; pageCount: number; resultCount: number; total: number; onPage: (page: number) => void;
}) {
return <div className="flex flex-wrap items-center justify-between gap-3">
<Text variant="supporting" role="status" aria-live="polite" className="text-text-muted">
{resultCount ? `${(page - 1) * MEMBER_PAGE_SIZE + 1}–${Math.min(page * MEMBER_PAGE_SIZE, resultCount)} of ${resultCount}` : "0 results"}
{resultCount !== total ? ` · ${total} total saved` : ""}
</Text>
<Pagination aria-label="Invitee pages" className="mx-0 w-auto">
<PaginationContent>
<PaginationItem><Button type="button" variant="outline" size="sm" onClick={() => onPage(page - 1)} disabled={page <= 1}>Previous</Button></PaginationItem>
<PaginationItem><Button type="button" variant="outline" size="sm" onClick={() => onPage(page + 1)} disabled={page >= pageCount}>Next</Button></PaginationItem>
</PaginationContent>
</Pagination>
</div>;
}
All sources and standards