Sha256: b3d8bcac3f7ef5b226c469018d6b00e571a725acdd2f4a06bf4839c06a176bac
Contents?: true
Size: 1.06 KB
Versions: 9
Compression:
Stored size: 1.06 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} updateParamsByUrl={false} /> </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
9 entries across 9 versions & 1 rubygems