diff --git a/packages/browser/src/components/Pagination.tsx b/packages/browser/src/components/Pagination.tsx index 0806649bc..7f1da5660 100644 --- a/packages/browser/src/components/Pagination.tsx +++ b/packages/browser/src/components/Pagination.tsx @@ -1,18 +1,19 @@ import { cn, cx } from '@stump/components' import { ArrowLeft, ArrowRight, MoreHorizontal } from 'lucide-react' -import { useMemo } from 'react' +import { useCallback, useMemo } from 'react' import { useWindowSize } from 'rooks' import { usePagination } from '../hooks/usePagination' import PagePopoverForm from './PagePopoverForm' -interface PaginationArrowProps { +type PaginationArrowProps = { kind: 'previous' | 'next' isDisabled?: boolean onClick: () => void + onMouseEnter?: () => void } -function PaginationArrow({ kind, isDisabled, onClick }: PaginationArrowProps) { +function PaginationArrow({ kind, isDisabled, onClick, onMouseEnter }: PaginationArrowProps) { const ArrowIcon = kind === 'previous' ? ArrowLeft : ArrowRight // NOTE: notice I am wrapping the link (which will have pointer-events-none when @@ -23,6 +24,7 @@ function PaginationArrow({ kind, isDisabled, onClick }: PaginationArrowProps) { className={cx('items-center', kind === 'next' ? 'justify-end text-right' : 'justify-start', { 'cursor-not-allowed': isDisabled, })} + onMouseEnter={!isDisabled ? onMouseEnter : undefined} >