Skip to content

Commit

Permalink
display send to as a comma-separated list of strings in details
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-i committed Nov 2, 2023
1 parent 10b3239 commit 24f9fdb
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/components/notifications-config-detail.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React from 'react';

import { Card, CardContent, Chip, Stack, FormLabel } from '@mui/material';
import { Card, CardContent, Stack, FormLabel } from '@mui/material';
import { useTranslator } from '../hooks';
import { Scheduler } from '../handler';
import { LabeledValue } from './labeled-value';
import { Cluster } from './cluster';

type INotificationsConfigDetailProps = {
notificationsConfig: Scheduler.INotificationsConfig;
Expand All @@ -14,6 +13,7 @@ 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 (
Expand All @@ -25,13 +25,7 @@ export function NotificationsConfigDetail(
<Stack spacing={2}>
<LabeledValue
label={trans.__('Send to')}
value={
<Cluster gap={3} justifyContent="flex-start">
{props.notificationsConfig.send_to.map((email, idx) => (
<Chip key={idx} label={email} variant="outlined" />
))}
</Cluster>
}
value={sendTo}
style={{ flex: '1 1 100%' }}
/>
<LabeledValue
Expand Down

0 comments on commit 24f9fdb

Please sign in to comment.