@@ -21,6 +21,7 @@ import { showError, stopPropagation } from '@Common/Helper'
21
21
import { ConfirmationModalVariantType , DeleteConfirmationModalProps } from './types'
22
22
import ConfirmationModal from './ConfirmationModal'
23
23
import { CannotDeleteModal } from './CannotDeleteModal'
24
+ import { ForceDeleteConfirmationModal } from './ForceDeleteConfirmationModal'
24
25
25
26
export const DeleteConfirmationModal : React . FC < DeleteConfirmationModalProps > = ( {
26
27
title,
@@ -40,6 +41,7 @@ export const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = (
40
41
children,
41
42
} : DeleteConfirmationModalProps ) => {
42
43
const [ showCannotDeleteDialogModal , setCannotDeleteDialogModal ] = useState ( false )
44
+ const [ showForceDeleteModal , setForceDeleteModal ] = useState ( false )
43
45
const [ cannotDeleteText , setCannotDeleteText ] = useState ( renderCannotDeleteConfirmationSubTitle )
44
46
const [ isLoading , setLoading ] = useState ( isDeleting )
45
47
@@ -81,6 +83,8 @@ export const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = (
81
83
closeConfirmationModal ( )
82
84
}
83
85
86
+ const handleCloseForceDeleteModal = ( ) => setForceDeleteModal ( false )
87
+
84
88
const renderCannotDeleteDialogModal = ( ) => (
85
89
< CannotDeleteModal
86
90
title = { title }
@@ -90,6 +94,15 @@ export const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = (
90
94
/>
91
95
)
92
96
97
+ const renderForceDeleteModal = ( ) => (
98
+ < ForceDeleteConfirmationModal
99
+ title = { title }
100
+ subtitle = { subtitle }
101
+ onDelete = { onDelete }
102
+ closeConfirmationModal = { handleCloseForceDeleteModal }
103
+ />
104
+ )
105
+
93
106
const renderDeleteModal = ( ) => (
94
107
< ConfirmationModal
95
108
variant = { ConfirmationModalVariantType . delete }
@@ -117,8 +130,9 @@ export const DeleteConfirmationModal: React.FC<DeleteConfirmationModalProps> = (
117
130
118
131
return (
119
132
< >
120
- { ! showCannotDeleteDialogModal && renderDeleteModal ( ) }
133
+ { ! showCannotDeleteDialogModal && ! showForceDeleteModal && renderDeleteModal ( ) }
121
134
{ showCannotDeleteDialogModal && renderCannotDeleteDialogModal ( ) }
135
+ { showForceDeleteModal && renderForceDeleteModal ( ) }
122
136
</ >
123
137
)
124
138
}
0 commit comments