DeleteAppModal.tsx 1.1 KB

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