UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

24 lines (21 loc) 1.18 kB
import { __rest } from '../../node_modules/tslib/tslib.es6.js'; import React, { forwardRef } from 'react'; import PropTypes from 'prop-types'; import classNames from '../../_virtual/index.js'; import { CLink } from '../link/CLink.js'; const CPaginationItem = forwardRef((_a, ref) => { var { children, as, className } = _a, rest = __rest(_a, ["children", "as", "className"]); const Component = as !== null && as !== void 0 ? as : (rest.active ? 'span' : 'a'); return (React.createElement("li", Object.assign({ className: classNames('page-item', { active: rest.active, disabled: rest.disabled, }, className) }, (rest.active && { 'aria-current': 'page' })), Component === 'a' ? (React.createElement(CLink, Object.assign({ className: "page-link", as: Component }, rest, { ref: ref }), children)) : (React.createElement(Component, { className: "page-link", ref: ref }, children)))); }); CPaginationItem.propTypes = { as: PropTypes.elementType, children: PropTypes.node, className: PropTypes.string, }; CPaginationItem.displayName = 'CPaginationItem'; export { CPaginationItem }; //# sourceMappingURL=CPaginationItem.js.map