-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathnotifications-config-detail.tsx
More file actions
45 lines (41 loc) · 1.32 KB
/
notifications-config-detail.tsx
File metadata and controls
45 lines (41 loc) · 1.32 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
import React from 'react';
import { Card, CardContent, Stack, FormLabel } from '@mui/material';
import { useTranslator } from '../hooks';
import { Scheduler } from '../handler';
import { LabeledValue } from './labeled-value';
type INotificationsConfigDetailProps = {
notificationsConfig: Scheduler.INotificationsConfig;
};
export function NotificationsConfigDetail(
props: INotificationsConfigDetailProps
): JSX.Element {
const trans = useTranslator('jupyterlab');
const sendTo = props.notificationsConfig.send_to.join(', ');
const events = props.notificationsConfig.events.join(', ');
return (
<Card>
<CardContent>
<FormLabel component="legend" sx={{ mb: 2 }}>
{trans.__('Notifications Settings')}
</FormLabel>
<Stack spacing={2}>
<LabeledValue
label={trans.__('Send to')}
value={sendTo}
style={{ flex: '1 1 100%' }}
/>
<LabeledValue
label={trans.__('Notification events')}
value={events}
style={{ flex: '1 1 100%' }}
/>
<LabeledValue
label={trans.__('Include output')}
value={props.notificationsConfig.include_output ? 'True' : 'False'}
style={{ flex: '1 1 100%' }}
/>
</Stack>
</CardContent>
</Card>
);
}