-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDeleteRequiredReportModal.jsx
55 lines (51 loc) · 1.28 KB
/
DeleteRequiredReportModal.jsx
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
52
53
54
55
import React from 'react';
import BasicModal from '../BasicModal';
import PhasePill from '../PhasePill';
import PropTypes from 'prop-types';
import { AtPropType, BrowserPropType } from '../proptypes';
const DeleteRequiredReportModal = ({
at,
browser,
phase,
handleClose,
handleDeleteReqReport
}) => {
const handleDelete = () => {
handleDeleteReqReport({ atId: at.id, browserId: browser.id, phase });
handleClose();
};
return (
<BasicModal
show={true}
closeButton={false}
cancelButton={true}
headerSep={true}
title={
<p>
Delete {`${at.name} and ${browser.name} pair for `}
<PhasePill fullWidth={false} forHeader={true}>
{phase}
</PhasePill>
{' required reports'}
</p>
}
dialogClassName="modal-50w"
actions={[
{
label: 'Confirm Delete',
onClick: handleDelete
}
]}
handleClose={handleClose}
staticBackdrop={true}
/>
);
};
DeleteRequiredReportModal.propTypes = {
at: AtPropType.isRequired,
browser: BrowserPropType.isRequired,
phase: PropTypes.string.isRequired,
handleClose: PropTypes.func.isRequired,
handleDeleteReqReport: PropTypes.func.isRequired
};
export default DeleteRequiredReportModal;