-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathindex.tsx
More file actions
74 lines (63 loc) · 2.07 KB
/
index.tsx
File metadata and controls
74 lines (63 loc) · 2.07 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
import AlertBox from '@node-core/ui-components/Common/AlertBox';
import { Modal, Title, Content } from '@node-core/ui-components/Common/Modal';
import { useTranslations } from 'next-intl';
import type { FC } from 'react';
import { MinorReleasesTable } from '#site/components/Downloads/MinorReleasesTable';
import { ReleaseOverview } from '#site/components/Downloads/ReleaseOverview';
import Link from '#site/components/Link';
import type { ModalProps, NodeRelease } from '#site/types';
const ReleaseModal: FC<ModalProps<NodeRelease>> = ({
open,
closeModal,
data,
}) => {
const t = useTranslations();
const modalHeadingKey = data.codename
? 'components.releaseModal.title'
: 'components.releaseModal.titleWithoutCodename';
const modalHeading = t(modalHeadingKey, {
version: data.major,
codename: data.codename ?? '',
});
return (
<Modal open={open} onOpenChange={closeModal}>
{data.status === 'End-of-life' && (
<div className="mb-4">
<AlertBox
title={t('components.common.alertBox.warning')}
level="warning"
size="small"
>
{t.rich('components.releaseModal.unsupportedVersionWarning', {
link: text => (
<Link onClick={closeModal} href="/eol">
{text}
</Link>
),
})}
</AlertBox>
</div>
)}
{data.isLts && (
<div className="mb-4">
<AlertBox
title={t('components.common.alertBox.info')}
level="info"
size="small"
>
{t.rich('components.releaseModal.ltsVersionFeaturesNotice', {
link: text => <Link href="/download/current">{text}</Link>,
})}
</AlertBox>
</div>
)}
<Title>{modalHeading}</Title>
<Content>
<ReleaseOverview release={data} />
<h5>{t('components.releaseModal.minorVersions')}</h5>
<MinorReleasesTable releases={data.minorVersions} />
</Content>
</Modal>
);
};
export default ReleaseModal;