import { classy } from '@audentio/utils/src/classy'; import React, { Component } from 'react'; import { ActivityIndicator } from '../../ActivityIndicator'; import { Icon } from '../../Icon'; import style from './TablePagination.scss'; export default class TablePagination extends Component { public render() { const { cursor, onPageChange, loading } = this.props; const totalPages = cursor && Math.ceil(cursor.total / cursor.perPage); if (!cursor || totalPages <= 1 || !onPageChange) return null; return (
{cursor.total} Total items
{loading && } { onPageChange(cursor.currentPage - 1); }} />
{cursor.currentPage} of {totalPages}
{ onPageChange(cursor.currentPage + 1); }} />
); } }