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
49 lines (43 loc) · 1.4 KB
/
index.tsx
File metadata and controls
49 lines (43 loc) · 1.4 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
'use client';
import { useTranslations } from 'next-intl';
import type { FC } from 'react';
import Link from '#site/components/Link';
import { OperatingSystemLabel } from '#site/util/downloadUtils';
import type { NodeDownloadArtifact } from '#site/util/downloadUtils/simple';
type DownloadsTableProps = {
source: Array<NodeDownloadArtifact>;
};
const DownloadsTable: FC<DownloadsTableProps> = ({ source }) => {
const t = useTranslations();
return (
<table>
<thead>
<tr>
<th>{t('components.downloadsTable.fileName')}</th>
<th className="md:w-24">
{t('components.downloadsTable.operatingSystem')}
</th>
<th className="md:w-24">
{t('components.downloadsTable.architecture')}
</th>
</tr>
</thead>
<tbody>
{source.map(release => (
<tr key={`${release.file}-${release.architecture}`}>
<td data-label={t('components.downloadsTable.fileName')}>
<Link href={release.url}>{release.file}</Link>
</td>
<td data-label={t('components.downloadsTable.operatingSystem')}>
{OperatingSystemLabel[release.os]}
</td>
<td data-label={t('components.downloadsTable.architecture')}>
{release.architecture}
</td>
</tr>
))}
</tbody>
</table>
);
};
export default DownloadsTable;