DeleteAppModal.tsx42 lines · main
1import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'
2
3import { PrivateApp } from '../PrivateAppsContext'
4
5interface DeleteAppModalProps {
6 app: PrivateApp | null
7 visible: boolean
8 isLoading?: boolean
9 onClose: () => void
10 onConfirm: () => void
11}
12
13export function DeleteAppModal({
14 app,
15 visible,
16 isLoading,
17 onClose,
18 onConfirm,
19}: DeleteAppModalProps) {
20 return (
21 <ConfirmationModal
22 variant="destructive"
23 visible={visible}
24 title={`Delete "${app?.name}"`}
25 confirmLabel="Delete app"
26 confirmLabelLoading="Deleting..."
27 loading={isLoading}
28 onCancel={onClose}
29 onConfirm={onConfirm}
30 alert={{
31 title: 'This action cannot be undone',
32 description:
33 'Deleting this app will invalidate any tokens generated using its private key. All installations will also be removed.',
34 }}
35 >
36 <p className="text-sm text-foreground-light">
37 Are you sure you want to delete <strong>{app?.name}</strong>? This will also remove all
38 installations associated with this app.
39 </p>
40 </ConfirmationModal>
41 )
42}