Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const Pagination = ({
totalPages,
totalCount,
pageSize,
currentPage,
onCurrentPageChange,
getMessage,
}) => {
const from = firstRowOnPage(currentPage, pageSize, totalCount);
const to = lastRowOnPage(currentPage, pageSize, totalCount);
return (
<button>}
disabled={currentPage === 0}
onClick={() => (currentPage > 0) && onCurrentPageChange(currentPage - 1)}
/>
{renderPageButtons(currentPage, totalPages, onCurrentPageChange)}
</button>
var PaginationBase = function PaginationBase(_ref2) {
var totalPages = _ref2.totalPages,
totalCount = _ref2.totalCount,
pageSize = _ref2.pageSize,
currentPage = _ref2.currentPage,
onCurrentPageChange = _ref2.onCurrentPageChange,
getMessage = _ref2.getMessage,
classes = _ref2.classes;
var from = firstRowOnPage(currentPage, pageSize, totalCount);
var to = lastRowOnPage(currentPage, pageSize, totalCount);
return React.createElement(
'div',
{ className: classes.pagination },
React.createElement(
'span',
{ className: classes.rowsLabel },
getMessage('info', { from: from, to: to, count: totalCount })
),
React.createElement(
IconButton,
{
className: classNames(classes.arrowButton, classes.prev),
disabled: currentPage === 0,
onClick: function onClick() {
return currentPage > 0 && onCurrentPageChange(currentPage - 1);
var PaginationBase = function PaginationBase(_ref2) {
var totalPages = _ref2.totalPages,
totalCount = _ref2.totalCount,
pageSize = _ref2.pageSize,
currentPage = _ref2.currentPage,
onCurrentPageChange = _ref2.onCurrentPageChange,
getMessage = _ref2.getMessage,
classes = _ref2.classes;
var from = dxGridCore.firstRowOnPage(currentPage, pageSize, totalCount);
var to = dxGridCore.lastRowOnPage(currentPage, pageSize, totalCount);
return React.createElement(
'div',
{ className: classes.pagination },
React.createElement(
'span',
{ className: classes.rowsLabel },
getMessage('info', { from: from, to: to, count: totalCount })
),
React.createElement(
IconButton,
{
className: classNames(classes.arrowButton, classes.prev),
disabled: currentPage === 0,
onClick: function onClick() {
return currentPage > 0 && onCurrentPageChange(currentPage - 1);