UNPKG

@s-ui/react-molecule-pagination

Version:

`MoleculePagination` is a component that displays a range of pages with the current page highlighted and the proper buttons to navigate across the available pages in the entire range of total pages

17 lines (16 loc) 589 B
import { getMessageErrorNumber, getMessageErrorPositive } from './helpers.js'; var isValidTotalPages = function isValidTotalPages(props, propName, componentName) { var totalPages = props[propName]; if (totalPages === undefined) return null; if (typeof totalPages !== 'number') return new Error(getMessageErrorNumber({ propName: propName, componentName: componentName })); if (totalPages <= 0) return new Error(getMessageErrorPositive({ propName: propName, componentName: componentName })); // assume all ok return null; }; export default isValidTotalPages;