mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-21 20:18:11 +02:00
24 lines
No EOL
510 B
TypeScript
24 lines
No EOL
510 B
TypeScript
'use client';
|
|
|
|
import { Pagination as NextUiPagination } from "@nextui-org/react";
|
|
import { usePathname, useRouter } from "next/navigation";
|
|
|
|
export function Pagination({
|
|
total,
|
|
page,
|
|
}: {
|
|
total: number;
|
|
page: number;
|
|
}) {
|
|
const pathname = usePathname();
|
|
const router = useRouter();
|
|
|
|
return <NextUiPagination
|
|
showControls
|
|
total={total}
|
|
initialPage={page}
|
|
onChange={(page) => {
|
|
router.push(`${pathname}?page=${page}`);
|
|
}}
|
|
/>;
|
|
} |