MCPcopy
hub / github.com/adrianhajdin/project_next13_car_showcase / ShowMore

Function ShowMore

components/ShowMore.tsx:9–34  ·  view source on GitHub ↗
({ pageNumber, isNext }: ShowMoreProps)

Source from the content-addressed store, hash-verified

7import { CustomButton } from "@components";
8
9const 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
36export default ShowMore;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected