btn disabled condition

This commit is contained in:
VividTruthKeeper 2023-03-07 15:30:13 +05:00
parent 0c99f8a155
commit a883c65870
1 changed files with 2 additions and 1 deletions

View File

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