import React, { useMemo } from 'react' import useTheme from '../use-theme' import { addColorAlpha } from '../utils/color' interface Props { active?: boolean disabled?: boolean onClick?: (e: React.MouseEvent) => void } type NativeAttrs = Omit, keyof Props> export type PaginationItemProps = Props & NativeAttrs const PaginationItem: React.FC> = ({ active, children, disabled, onClick, ...props }) => { const theme = useTheme() const [hover, activeHover] = useMemo( () => [addColorAlpha(theme.palette.success, 0.1), addColorAlpha(theme.palette.success, 0.8)], [theme.palette.success] ) const clickHandler = (event: React.MouseEvent) => { if (disabled) return onClick && onClick(event) } return (
  • ) } export default PaginationItem