MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / PageNavigation

Function PageNavigation

apps/baseai.dev/src/components/Footer.tsx:45–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43}
44
45function PageNavigation() {
46 let pathname = usePathname();
47 const isLearnPath = pathname.startsWith('/learn');
48 const navLinks = isLearnPath ? navLearn : navigationData;
49
50 let allPages = navLinks.flatMap(group => group.links);
51 let currentPageIndex = allPages.findIndex(page => page.href === pathname);
52
53 if (currentPageIndex === -1) {
54 return null;
55 }
56
57 let previousPage = allPages[currentPageIndex - 1];
58 let nextPage = allPages[currentPageIndex + 1];
59
60 if (!previousPage && !nextPage) {
61 return null;
62 }
63
64 return (
65 <div className="prose flex dark:prose-invert">
66 {previousPage && (
67 <div className="flex flex-col items-start gap-3">
68 <PageLink label="Previous" page={previousPage} previous />
69 </div>
70 )}
71 {nextPage && (
72 <div className="ml-auto flex flex-col items-end gap-3">
73 <PageLink label="Next" page={nextPage} />
74 </div>
75 )}
76 </div>
77 );
78}
79
80function Socials() {
81 return (

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected