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

30 lines 1.08 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; var _excluded = ["onSelectPage", "page", "design", "color"]; import PropTypes from 'prop-types'; import AtomButton from '@s-ui/react-atom-button'; import { isValidPage } from './customPropTypes/index.js'; import { BASE_CLASS } from './settings.js'; import { jsx as _jsx } from "react/jsx-runtime"; var PageButton = function PageButton(_ref) { var onSelectPage = _ref.onSelectPage, page = _ref.page, design = _ref.design, color = _ref.color, props = _objectWithoutPropertiesLoose(_ref, _excluded); var _onSelectPage = function _onSelectPage(e) { onSelectPage(e, { page: page }); }; return /*#__PURE__*/_jsx("li", { className: BASE_CLASS + "-item", children: /*#__PURE__*/_jsx(AtomButton, _extends({ onClick: _onSelectPage, design: design, color: color }, props)) }); }; PageButton.displayName = 'MoleculePaginationPageButton'; export default PageButton;