diff --git a/frontend/src/components/DocumentPagination.tsx b/frontend/src/components/DocumentPagination.tsx new file mode 100644 index 00000000..b5d82456 --- /dev/null +++ b/frontend/src/components/DocumentPagination.tsx @@ -0,0 +1,115 @@ +import React, { useState } from 'react'; +import SingleArrowLeft from '../assets/single-left-arrow.svg'; +import SingleArrowRight from '../assets/single-right-arrow.svg'; +import DoubleArrowLeft from '../assets/double-arrow-left.svg'; +import DoubleArrowRight from '../assets/double-arrow-right.svg'; + +interface PaginationProps { + currentPage: number; + totalPages: number; + rowsPerPage: number; + onPageChange: (page: number) => void; + onRowsPerPageChange: (rows: number) => void; +} + +const Pagination: React.FC = ({ + currentPage, + totalPages, + rowsPerPage, + onPageChange, + onRowsPerPageChange, +}) => { + const [rowsPerPageOptions] = useState([5, 10, 15, 20]); + + const handlePreviousPage = () => { + if (currentPage > 1) { + onPageChange(currentPage - 1); + } + }; + + const handleNextPage = () => { + if (currentPage < totalPages) { + onPageChange(currentPage + 1); + } + }; + + const handleFirstPage = () => { + onPageChange(1); + }; + + const handleLastPage = () => { + onPageChange(totalPages); + }; + + return ( +
+
+ Rows per page: + +
+ +
+ Page {currentPage} of {totalPages} +
+ +
+ + + + +
+
+ ); +}; + +export default Pagination;