1- 'use client' ;
2-
1+ import BadgeGroup from '@node-core/ui-components/Common/BadgeGroup' ;
32import Footer from '@node-core/ui-components/Containers/Footer' ;
4- import { useTranslations } from 'next-intl' ;
3+ import { getTranslations } from 'next-intl/server ' ;
54import type { FC } from 'react' ;
65
6+ import { getClientContext } from '#site/client-context' ;
77import Link from '#site/components/Link' ;
8- import { usePathname } from '#site/navigation.mjs' ;
98import { siteNavigation } from '#site/next.json.mjs' ;
109
11- const WithFooter : FC = ( ) => {
12- const t = useTranslations ( ) ;
13- const pathname = usePathname ( ) ;
10+ import WithNodeRelease from './withNodeRelease' ;
11+
12+ const WithFooter : FC = async ( ) => {
13+ const t = await getTranslations ( ) ;
14+ const { pathname } = getClientContext ( ) ;
1415
1516 const { socialLinks, footerLinks } = siteNavigation ;
17+
1618 const updatedFooterLinks = footerLinks
1719 . slice ( 0 , - 1 )
1820 . map ( link => ( { ...link , text : t ( link . text ) } ) ) ;
@@ -25,7 +27,43 @@ const WithFooter: FC = () => {
2527 footerLinks : updatedFooterLinks ,
2628 } ;
2729
28- return < Footer navigation = { navigation } as = { Link } pathname = { pathname } /> ;
30+ const primary = (
31+ < >
32+ < WithNodeRelease status = "Active LTS" >
33+ { ( { release } ) => (
34+ < BadgeGroup
35+ size = "small"
36+ kind = "info"
37+ badgeText = { release . versionWithPrefix }
38+ href = { `/blog/release/${ release . versionWithPrefix } ` }
39+ >
40+ { t ( 'components.containers.footer.releasePills.latestLTS' ) }
41+ </ BadgeGroup >
42+ ) }
43+ </ WithNodeRelease >
44+
45+ < WithNodeRelease status = "Current" >
46+ { ( { release } ) => (
47+ < BadgeGroup
48+ size = "small"
49+ badgeText = { release . versionWithPrefix }
50+ href = { `/blog/release/${ release . versionWithPrefix } ` }
51+ >
52+ { t ( 'components.containers.footer.releasePills.latestRelease' ) }
53+ </ BadgeGroup >
54+ ) }
55+ </ WithNodeRelease >
56+ </ >
57+ ) ;
58+
59+ return (
60+ < Footer
61+ navigation = { navigation }
62+ as = { Link }
63+ pathname = { pathname }
64+ slots = { { primary } }
65+ />
66+ ) ;
2967} ;
3068
3169export default WithFooter ;
0 commit comments