import React from 'react'; import { usePaginationContext } from './pagination-context'; import { PaginationItem } from './pagination-item'; export type PaginationNextProps = React.ButtonHTMLAttributes; export const PaginationNext: React.FC> = ({ children, ...props }) => { const { currentPage, isLast, update, resolveUrl } = usePaginationContext(); const href = isLast ? undefined : resolveUrl(currentPage + 1); return ( update && update('next')} href={href} rel={href && 'next'} {...props} > {children} ); }; PaginationNext.displayName = 'PaginationNext';