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
83 lines (76 loc) · 2.05 KB
/
index.tsx
File metadata and controls
83 lines (76 loc) · 2.05 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import {
CalendarIcon,
ClockIcon,
CodeBracketSquareIcon,
Square3Stack3DIcon,
} from '@heroicons/react/24/outline';
import { useTranslations } from 'next-intl';
import type { FC, ReactNode } from 'react';
import type { NodeRelease } from '@/types';
import styles from './index.module.css';
type ItemProps = {
icon: React.JSX.Element;
title: ReactNode;
subtitle: ReactNode;
};
const Item: FC<ItemProps> = ({ icon, title, subtitle }) => {
return (
<div className={styles.item}>
{icon}
<div>
<h2>{subtitle}</h2>
<h1>{title}</h1>
</div>
</div>
);
};
type ReleaseOverviewProps = {
release: NodeRelease;
};
export const ReleaseOverview: FC<ReleaseOverviewProps> = ({ release }) => {
const t = useTranslations();
return (
<div className={styles.root}>
<div className={styles.container}>
<Item
icon={<CalendarIcon />}
title={release.currentStart}
subtitle={t('components.releaseOverview.firstReleased')}
/>
{release.releaseDate && (
<Item
icon={<ClockIcon />}
title={release.releaseDate}
subtitle={t('components.releaseOverview.lastUpdated')}
/>
)}
<Item
icon={<Square3Stack3DIcon />}
title={release.minorVersions.length}
subtitle={t('components.releaseOverview.minorVersions')}
/>
{release.modules && (
<Item
icon={<CodeBracketSquareIcon />}
title={`v${release.modules}`}
subtitle={t('components.releaseOverview.nApiVersion')}
/>
)}
{release.npm && (
<Item
icon={<CodeBracketSquareIcon />}
title={`v${release.npm}`}
subtitle={t('components.releaseOverview.npmVersion')}
/>
)}
{release.v8 && (
<Item
icon={<CodeBracketSquareIcon />}
title={`v${release.v8}`}
subtitle={t('components.releaseOverview.v8Version')}
/>
)}
</div>
</div>
);
};