11import { getLocale , getTranslations } from 'next-intl/server' ;
22import type { FC , PropsWithChildren } from 'react' ;
33
4+ import { getClientContext } from '@/client-context' ;
45import LinkTabs from '@/components/Common/LinkTabs' ;
56import WithNodeRelease from '@/components/withNodeRelease' ;
6- import { useClientContext } from '@/hooks/react-server' ;
77import getDownloadSnippets from '@/next-data/downloadSnippets' ;
88import getReleaseData from '@/next-data/releaseData' ;
99import { defaultLocale } from '@/next.locales.mjs' ;
@@ -12,6 +12,7 @@ import type { NodeReleaseStatus } from '@/types';
1212import { getDownloadCategory , mapCategoriesToTabs } from '@/util/downloadUtils' ;
1313
1414// By default the translated languages do not contain all the download snippets
15+ // Hence we always merge any translated snippet with the fallbacks for missing snippets
1516const fallbackSnippets = await getDownloadSnippets ( defaultLocale . code ) ;
1617
1718const WithDownloadCategories : FC < PropsWithChildren > = async ( { children } ) => {
@@ -20,8 +21,7 @@ const WithDownloadCategories: FC<PropsWithChildren> = async ({ children }) => {
2021 const releases = await getReleaseData ( ) ;
2122 const snippets = await getDownloadSnippets ( locale ) ;
2223
23- // eslint-disable-next-line react-hooks/rules-of-hooks
24- const { pathname } = useClientContext ( ) ;
24+ const { pathname } = getClientContext ( ) ;
2525 const { page, category, subCategory } = getDownloadCategory ( pathname ) ;
2626
2727 const initialRelease : NodeReleaseStatus = pathname . includes ( 'current' )
0 commit comments