forked from nodejs/nodejs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
57 lines (52 loc) · 1.92 KB
/
index.tsx
File metadata and controls
57 lines (52 loc) · 1.92 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
import Badge from '@node-core/ui-components/Common/Badge';
import { getTranslations } from 'next-intl/server';
import type { FC } from 'react';
import DetailsButton from '@/components/Downloads/DownloadReleasesTable/DetailsButton';
import getReleaseData from '@/next-data/releaseData';
// This is a React Async Server Component
// Note that Hooks cannot be used in a RSC async component
// Async Components do not get re-rendered at all.
const DownloadReleasesTable: FC = async () => {
const releaseData = await getReleaseData();
const t = await getTranslations();
return (
<table id="tbVersions" className="download-table full-width">
<thead>
<tr>
<th>{t('components.downloadReleasesTable.version')}</th>
<th>{t('components.downloadReleasesTable.codename')}</th>
<th>{t('components.downloadReleasesTable.firstReleased')}</th>
<th>{t('components.downloadReleasesTable.lastUpdated')}</th>
<th>{t('components.downloadReleasesTable.status')}</th>
<th></th>
</tr>
</thead>
<tbody>
{releaseData.map(release => (
<tr key={release.major}>
<td data-label="Version">v{release.major}</td>
<td data-label="LTS">{release.codename || '-'}</td>
<td data-label="Date">
<time>{release.currentStart}</time>
</td>
<td data-label="Date">
<time>{release.releaseDate}</time>
</td>
<td data-label="Status">
<Badge
kind={release.status === 'End-of-life' ? 'warning' : 'default'}
size="small"
>
{release.status}
</Badge>
</td>
<td className="download-table-last">
<DetailsButton versionData={release} />
</td>
</tr>
))}
</tbody>
</table>
);
};
export default DownloadReleasesTable;