import React from "react"; import PropTypes from "prop-types"; import cn from "classnames"; import { IPageItemProps } from "./pagination.d"; const PageItem = (props: IPageItemProps) => { const { children, onClick, active = false, disabled = false } = props; const onLinkClick = (e: React.SyntheticEvent) => { e.preventDefault(); onClick(); }; return (
  • {disabled || active ? (
    {children}
    ) : (
    {children}
    )}
  • ); }; PageItem.displayName = "Pagination Item"; PageItem.defaultProps = { active: false, disabled: false }; PageItem.propTypes = { active: PropTypes.bool, disabled: PropTypes.bool, onClick: PropTypes.func }; export default PageItem;