This commit is contained in:
Kakabay 2023-03-07 15:29:44 +05:00
commit 1f9cba7088
1 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ interface IProps {
} }
const Pagination = ({ pages, activePage, setActivePage }: IProps) => { const Pagination = ({ pages, activePage, setActivePage }: IProps) => {
console.log(pages, activePage + 1);
const handleOnClick = (page: number) => { const handleOnClick = (page: number) => {
setActivePage(page); setActivePage(page);
}; };
@ -26,7 +27,7 @@ const Pagination = ({ pages, activePage, setActivePage }: IProps) => {
</div> </div>
<button <button
type="button" type="button"
disabled={activePage + 1 > pages} disabled={activePage + 1 >= pages}
onClick={() => handleOnClick(activePage + 1)} onClick={() => handleOnClick(activePage + 1)}
> >
<Arr className="pagination-arr pagination-arr-right" /> <Arr className="pagination-arr pagination-arr-right" />