-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathindex.tsx
More file actions
65 lines (58 loc) · 1.87 KB
/
index.tsx
File metadata and controls
65 lines (58 loc) · 1.87 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
'use client';
import Separator from '@node-core/ui-components/Common/Separator';
import { useTranslations } from 'next-intl';
import type { FC } from 'react';
import Link from '#site/components/Link';
import { BASE_CHANGELOG_URL } from '#site/next.constants.mjs';
import type { MinorVersion } from '#site/types';
import { getNodeApiUrl } from '#site/util/url';
import styles from './index.module.css';
type MinorReleasesTableProps = {
releases: Array<MinorVersion>;
};
export const MinorReleasesTable: FC<MinorReleasesTableProps> = ({
releases,
}) => {
const t = useTranslations();
return (
<table>
<thead>
<tr>
<th>{t('components.minorReleasesTable.version')}</th>
<th>{t('components.minorReleasesTable.links')}</th>
</tr>
</thead>
<tbody>
{releases.map(release => (
<tr key={release.version}>
<td>v{release.version}</td>
<td>
<div className={styles.links}>
<Link
kind="neutral"
href={`https://nodejs.org/download/release/v${release.version}/`}
>
{t('components.minorReleasesTable.actions.release')}
</Link>
<Separator orientation="vertical" />
<Link
kind="neutral"
href={`${BASE_CHANGELOG_URL}${release.version}`}
>
{t('components.minorReleasesTable.actions.changelog')}
</Link>
<Separator orientation="vertical" />
<Link
kind="neutral"
href={getNodeApiUrl(`v${release.version}`)}
>
{t('components.minorReleasesTable.actions.docs')}
</Link>
</div>
</td>
</tr>
))}
</tbody>
</table>
);
};