diff --git a/src/App.tsx b/src/App.tsx index 189a990c8..946a5f872 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,17 +1,22 @@ import React from 'react'; import './App.css'; import { getNumbers } from './utils'; +import { Pagination } from './components/Pagination'; // eslint-disable-next-line @typescript-eslint/no-unused-vars const items = getNumbers(1, 42).map(n => `Item ${n}`); export const App: React.FC = () => { + const [currentPage, setCurrentPage] = React.useState(1); + const [perPage, setPerPage] = React.useState(5); + return (

Items with Pagination

- Page 1 (items 1 - 5 of 42) + Page {currentPage} (items {(currentPage - 1) * perPage + 1} -{' '} + {Math.min(currentPage * perPage, items.length)} of {items.length})

@@ -19,7 +24,13 @@ export const App: React.FC = () => {