({ pageNumber, isNext }: ShowMoreProps)
| 7 | import { CustomButton } from "@components"; |
| 8 | |
| 9 | const ShowMore = ({ pageNumber, isNext }: ShowMoreProps) => { |
| 10 | const router = useRouter(); |
| 11 | |
| 12 | const handleNavigation = () => { |
| 13 | // Calculate the new limit based on the page number and navigation type |
| 14 | const newLimit = (pageNumber + 1) * 10; |
| 15 | |
| 16 | // Update the "limit" search parameter in the URL with the new value |
| 17 | const newPathname = updateSearchParams("limit", `${newLimit}`); |
| 18 | |
| 19 | router.push(newPathname); |
| 20 | }; |
| 21 | |
| 22 | return ( |
| 23 | <div className="w-full flex-center gap-5 mt-10"> |
| 24 | {!isNext && ( |
| 25 | <CustomButton |
| 26 | btnType="button" |
| 27 | title="Show More" |
| 28 | containerStyles="bg-primary-blue rounded-full text-white" |
| 29 | handleClick={handleNavigation} |
| 30 | /> |
| 31 | )} |
| 32 | </div> |
| 33 | ); |
| 34 | }; |
| 35 | |
| 36 | export default ShowMore; |
nothing calls this directly
no outgoing calls
no test coverage detected