Improve delete folder message

This commit is contained in:
Carlos Monastyrski
2025-08-13 16:13:38 -07:00
parent b0d24de008
commit bad934de48
2 changed files with 20 additions and 1 deletions
@@ -16,7 +16,7 @@ import { ProjectPermissionCan } from "@app/components/permissions";
import { DeleteActionModal, IconButton, Modal, ModalContent } from "@app/components/v2";
import { Tooltip } from "@app/components/v2/Tooltip/Tooltip";
import { ROUTE_PATHS } from "@app/const/routes";
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
import { ProjectPermissionActions, ProjectPermissionSub, useSubscription } from "@app/context";
import { usePopUp } from "@app/hooks";
import { useDeleteFolder, useUpdateFolder } from "@app/hooks/api";
import { PendingAction, TSecretFolder } from "@app/hooks/api/secretFolders/types";
@@ -54,6 +54,7 @@ export const FolderListView = ({
from: ROUTE_PATHS.SecretManager.SecretDashboardPage.id,
select: (el) => el.secretPath
});
const { subscription } = useSubscription();
const { mutateAsync: updateFolder } = useUpdateFolder();
const { mutateAsync: deleteFolder } = useDeleteFolder();
@@ -319,6 +320,11 @@ export const FolderListView = ({
isOpen={popUp.deleteFolder.isOpen}
deleteKey={(popUp.deleteFolder?.data as TSecretFolder)?.name}
title="Do you want to delete this folder?"
subTitle={`This folder and all its contents will be removed. ${
subscription?.pitRecovery
? "You can reverse this action by rolling back to a previous commit."
: "Rolling back to a previous commit isn't available on your current plan. Upgrade to enable this feature."
}`}
onChange={(isOpen) => handlePopUpToggle("deleteFolder", isOpen)}
onDeleteApproved={handleFolderDelete}
/>