-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathwithReleaseAlertBox.tsx
More file actions
46 lines (40 loc) · 1.18 KB
/
withReleaseAlertBox.tsx
File metadata and controls
46 lines (40 loc) · 1.18 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
import AlertBox from '@node-core/ui-components/Common/AlertBox';
import { useTranslations } from 'next-intl';
import Link from '#site/components/Link';
import type { NodeReleaseStatus } from '#site/types';
import type { FC } from 'react';
type WithReleaseAlertBoxProps = {
status: NodeReleaseStatus;
};
const WithReleaseAlertBox: FC<WithReleaseAlertBoxProps> = ({ status }) => {
const t = useTranslations();
switch (status) {
case 'EOL':
return (
<AlertBox
title={t('components.common.alertBox.warning')}
level="warning"
size="small"
>
{t.rich('layouts.download.codeBox.unsupportedVersionWarning', {
link: text => <Link href="/about/eol">{text}</Link>,
})}
</AlertBox>
);
case 'LTS':
return (
<AlertBox
title={t('components.common.alertBox.info')}
level="success"
size="small"
>
{t.rich('components.releaseModal.ltsVersionFeaturesNotice', {
link: text => <Link href="/download/current">{text}</Link>,
})}
</AlertBox>
);
default:
return null;
}
};
export default WithReleaseAlertBox;