-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathwithFooter.tsx
More file actions
69 lines (58 loc) · 1.81 KB
/
withFooter.tsx
File metadata and controls
69 lines (58 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import BadgeGroup from '@node-core/ui-components/Common/BadgeGroup';
import Footer from '@node-core/ui-components/Containers/Footer';
import { useTranslations } from 'next-intl';
import { getClientContext } from '#site/client-context';
import Link from '#site/components/Link';
import { siteNavigation } from '#site/next.json.mjs';
import type { FC } from 'react';
import WithLegal from './withLegal';
import WithNodeRelease from './withNodeRelease';
const WithFooter: FC = () => {
const t = useTranslations();
const { pathname } = getClientContext();
const { socialLinks, footerLinks } = siteNavigation;
const navigation = {
socialLinks,
footerLinks: footerLinks.map(link => ({
...link,
translation: t(link.text),
})),
};
const primary = (
<div className="flex flex-row gap-2">
<WithNodeRelease status="LTS">
{({ release }) => (
<BadgeGroup
size="small"
kind="info"
badgeText={release.versionWithPrefix}
href={`/blog/release/${release.versionWithPrefix}`}
>
{t('components.containers.footer.releasePills.latestLTS')}
</BadgeGroup>
)}
</WithNodeRelease>
<WithNodeRelease status="Current">
{({ release }) => (
<BadgeGroup
size="small"
badgeText={release.versionWithPrefix}
href={`/blog/release/${release.versionWithPrefix}`}
>
{t('components.containers.footer.releasePills.latestRelease')}
</BadgeGroup>
)}
</WithNodeRelease>
</div>
);
const legal = <WithLegal footerLinks={navigation.footerLinks} />;
return (
<Footer
navigation={navigation}
as={Link}
pathname={pathname}
slots={{ primary, legal }}
/>
);
};
export default WithFooter;