diff --git a/apps/site/components/withSidebarCrossLinks.tsx b/apps/site/components/withSidebarCrossLinks.tsx deleted file mode 100644 index 565b459524859..0000000000000 --- a/apps/site/components/withSidebarCrossLinks.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { getClientContext } from '#site/client-context'; -import CrossLink from '#site/components/Common/CrossLink'; -import useSiteNavigation from '#site/hooks/useSiteNavigation'; - -import type { NavigationKeys } from '#site/types'; -import type { FC } from 'react'; - -type WithCrossLinksProps = { navKey: NavigationKeys }; - -const WithSidebarCrossLinks: FC = ({ navKey }) => { - const { getSideNavigation } = useSiteNavigation(); - const { pathname } = getClientContext(); - - const [[, sidebarNavigation]] = getSideNavigation([navKey]); - - const crossLinkItems = sidebarNavigation.items - .map(([, { items }]) => items.map(([, item]) => item)) - .flat(); - - const currentItem = crossLinkItems.findIndex(({ link }) => link === pathname); - - const [previousCrossLink, nextCrossLink] = [ - crossLinkItems[currentItem - 1], - crossLinkItems[currentItem + 1], - ]; - - return ( -
- {(previousCrossLink && ( - - )) ||
} - - {nextCrossLink && ( - - )} -
- ); -}; - -export default WithSidebarCrossLinks;