-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathExecutorDocumentationLink.tsx
51 lines (46 loc) · 1.81 KB
/
ExecutorDocumentationLink.tsx
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
import { Alert, Typography } from '@mui/material';
import { useTheme } from '@mui/material/styles';
import { type FunctionComponent, useEffect } from 'react';
import { useFormatter } from '../../../components/i18n';
import { type Executor } from '../../../utils/api-types';
import useEnterpriseEdition from '../../../utils/hooks/useEnterpriseEdition';
import EEChip from '../common/entreprise_edition/EEChip';
interface Props { executor: Executor }
const ExecutorDocumentationLink: FunctionComponent<Props> = ({ executor }) => {
// Standard hooks
const { t } = useFormatter();
const theme = useTheme();
const { openDialog, setFeatureDetectedInfo } = useEnterpriseEdition();
useEffect(() => {
}, []);
const onAlertClick = () => {
setFeatureDetectedInfo(executor.executor_name);
openDialog();
};
return (
<div style={{
display: 'grid',
gap: theme.spacing(2),
}}
>
<Alert style={{ cursor: 'pointer' }} icon={<EEChip style={{ marginTop: theme.spacing(1) }} />} severity="success" onClick={onAlertClick}>
{`${executor.executor_name} ${t('executor is an enterprise edition feature. You can start the set up but you will need a license key to execute your injects. We provide a 3 month trial to let you test the platform at full capacity.')} `}
</Alert>
{executor.executor_doc && (
<Typography variant="body1">
{t('To install the agent please follow the ')}
<a target="_blank" href={executor.executor_doc} rel="noreferrer">
{`${executor.executor_name} ${t('documentation')}`}
</a>
.
</Typography>
)}
{!executor.executor_doc && (
<Typography variant="body1">
{t('No documentation available')}
</Typography>
)}
</div>
);
};
export default ExecutorDocumentationLink;