forked from ToolJet/ToolJet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSuccessNotificationInputs.jsx
More file actions
48 lines (47 loc) · 1.86 KB
/
SuccessNotificationInputs.jsx
File metadata and controls
48 lines (47 loc) · 1.86 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
import React from 'react';
import { useTranslation } from 'react-i18next';
import CodeHinter from '@/Editor/CodeEditor';
export default function SuccessNotificationInputs({ currentState, options, darkMode, optionchanged }) {
const { t } = useTranslation();
if (!options?.showSuccessNotification) {
return <div className="mb-3"></div>;
}
return (
<div className="flex-grow-1" style={{ margin: '16px 0px' }}>
<div className="d-flex" style={{ marginBottom: '16px' }}>
<label className="form-label align-items-center" data-cy={'label-success-message-input'} style={{ width: 150 }}>
{t('editor.queryManager.successMessage', 'Message')}
</label>
<div className="flex-grow-1" style={{ maxWidth: '460px' }}>
<CodeHinter
type="basic"
initialValue={options.successMessage}
onChange={(value) => optionchanged('successMessage', value)}
placeholder={t('editor.queryManager.queryRanSuccessfully', 'Query ran successfully')}
cyLabel={'success-message'}
/>
</div>
</div>
<div className="d-flex">
<label
className="form-label align-items-center"
data-cy={'label-notification-duration-input'}
style={{ width: 150 }}
>
{t('editor.queryManager.notificationDuration', 'duration (s)')}
</label>
<div className="flex-grow-1 query-manager-input-elem" style={{ maxWidth: '460px' }}>
<input
type="number"
disabled={!options.showSuccessNotification}
onChange={(e) => optionchanged('notificationDuration', e.target.value)}
placeholder={5}
className="form-control"
value={options.notificationDuration}
data-cy={'notification-duration-input-field'}
/>
</div>
</div>
</div>
);
}