mirror of
https://github.com/zhigang1992/react.git
synced 2026-04-29 04:35:32 +08:00
20 lines
544 B
TypeScript
20 lines
544 B
TypeScript
import React from 'react'
|
|
import PaginationItem from './pagination-item'
|
|
import { usePaginationContext } from './pagination-context'
|
|
|
|
export type PaginationNextProps = React.ButtonHTMLAttributes<any>
|
|
|
|
const PaginationNext: React.FC<React.PropsWithChildren<PaginationNextProps>> = ({
|
|
children,
|
|
...props
|
|
}) => {
|
|
const { update, isLast } = usePaginationContext()
|
|
return (
|
|
<PaginationItem onClick={() => update && update('next')} disabled={isLast} {...props}>
|
|
{children}
|
|
</PaginationItem>
|
|
)
|
|
}
|
|
|
|
export default PaginationNext
|