diff --git a/frontend/src/_components/Pagination.jsx b/frontend/src/_components/Pagination.jsx new file mode 100644 index 0000000000..d19e6c86d7 --- /dev/null +++ b/frontend/src/_components/Pagination.jsx @@ -0,0 +1,39 @@ +import React, { useState, useEffect } from 'react'; + +export const Pagination = function Pagination({ + currentPage, count, totalPages, pageChanged +}) { + + function renderPageItem(i) { + return
  • gotoPage(i + 1)} className={`page-item ${currentPage === i + 1 ? 'active' : ''}`}>{i + 1}
  • + } + + function gotoPage(page) { + pageChanged(page) + } + + function gotoNextPage() { + gotoPage(currentPage + 1); + } + + function gotoPreviousPage() { + gotoPage(currentPage - 1); + } + + return (
    +

    Showing 1 to 8 of {count} entries

    + +
    ) +}