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
47 lines (42 loc) · 1.37 KB
/
index.tsx
File metadata and controls
47 lines (42 loc) · 1.37 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
import { useTranslations } from 'next-intl';
import type { FC } from 'react';
import Link from '#site/components/Link';
import type { DownloadArtifact } from '#site/types';
import { OperatingSystemLabel } from '#site/util/download';
type DownloadsTableProps = {
source: Array<DownloadArtifact>;
};
const DownloadsTable: FC<DownloadsTableProps> = ({ source }) => {
const t = useTranslations();
return (
<table>
<thead>
<tr>
<th>{t('components.downloadsTable.fileName')}</th>
<th className="md:w-28">
{t('components.downloadsTable.operatingSystem')}
</th>
<th className="md:w-28">
{t('components.downloadsTable.architecture')}
</th>
</tr>
</thead>
<tbody>
{source.map(release => (
<tr key={`${release.fileName}-${release.architecture}`}>
<td data-label={t('components.downloadsTable.fileName')}>
<Link href={release.url}>{release.fileName}</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;