import type { ReactNode } from "react"; import Link from "next/link"; import { cn } from "cn"; import { buttonVariants } from "@/components/ui/button"; type PaginationProps = { page: number; hasNext: boolean; hrefPage: (page: number) => string; }; export function Pagination({ page, hasNext, hrefPage }: PaginationProps) { return (
Halaman {page}
1 ? hrefPage(page - 1) : null}> Sebelumnya Berikutnya
); } function TombolHalaman({ href, children, }: { href: string | null; children: ReactNode; }) { const className = buttonVariants({ variant: "outline", size: "sm" }); if (!href) { return ( {children} ); } return ( {children} ); }