()
| 43 | } |
| 44 | |
| 45 | function 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 | |
| 80 | function Socials() { |
| 81 | return ( |
nothing calls this directly
no outgoing calls
no test coverage detected