-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathempty-form-conformation-modal.tsx
42 lines (38 loc) · 1.19 KB
/
empty-form-conformation-modal.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
import React from 'react';
import { ComposedModal, ModalHeader, ModalBody, ModalFooter, Button } from '@carbon/react';
import { useTranslation } from 'react-i18next';
import styles from './empty-formconformation-modal.scss'
interface EmptyFormConfirmationModalProps {
onDiscard: () => void;
onConfirmation: () => void;
open: boolean;
}
const IncompleteFormConfirmationModal: React.FC<EmptyFormConfirmationModalProps> = ({
onDiscard,
onConfirmation,
open,
}) => {
const { t } = useTranslation();
return (
<ComposedModal open={open} onClose={onDiscard} className={styles.customModal} size="small">
<ModalHeader title={t('EmptyForm', 'Empty Form ')} />
<ModalBody>
<p >
{t(
'EmptyFormConfirmation',
'All fields are Empty. Are you sure you want to submit the form?',
)}
</p>
</ModalBody>
<ModalFooter >
<Button kind="secondary" onClick={onDiscard}>
{t('cancel', 'Cancel')}
</Button>
<Button kind="danger" onClick={onConfirmation}>
{t('confirm', 'Confirm')}
</Button>
</ModalFooter>
</ComposedModal>
);
};
export default IncompleteFormConfirmationModal;