import type { ReactNode } from 'react'; import { Link, useLocation } from 'react-router'; import { Button } from '~/components/ui/button'; import { cn } from '~/lib/utils'; interface PaginationLinkProps { page: number; active?: boolean; disabled?: boolean; label?: string; children: ReactNode; } // Links to another page of the current list, keeping its other search params (e.g. the filter) export function PaginationLink({ page, active, disabled, label, children }: PaginationLinkProps) { const { search } = useLocation(); const params = new URLSearchParams(search); params.set('page', String(page)); return ( ); }