Sha256: 664e9a19b09deaeb27124063fd81566e1b0855db9a183b81950ebcedf977284d
Contents?: true
Size: 1.03 KB
Versions: 38
Compression:
Stored size: 1.03 KB
Contents
import React from 'react'; import PropTypes from 'prop-types'; import { FlexItem } from '@patternfly/react-core'; import Pagination from 'foremanReact/components/Pagination'; import { getPageStats } from './helpers'; const PageControls = ({ variant, total, page, perPage, onPaginationUpdate, }) => { const { firstIndex, lastIndex } = getPageStats({ total, page, perPage }); return ( <FlexItem align={{ default: 'alignRight' }}> <Pagination ouiaId={`pagination-${variant}`} key={variant} itemCount={total} itemsStart={firstIndex} itemsEnd={lastIndex} page={page} perPage={perPage} onChange={onPaginationUpdate} variant={variant} /> </FlexItem> ); }; export default PageControls; PageControls.propTypes = { variant: PropTypes.string.isRequired, total: PropTypes.number, page: PropTypes.number, perPage: PropTypes.number, onPaginationUpdate: PropTypes.func.isRequired, }; PageControls.defaultProps = { total: 0, page: 1, perPage: 20, };
Version data entries
38 entries across 38 versions & 1 rubygems