Add tooltip to Remove Password tool

This commit is contained in:
James Brunton 2025-08-15 13:56:27 +01:00
parent 25cc9ec8d3
commit 196b1de21c
4 changed files with 29 additions and 0 deletions

View File

@ -1878,6 +1878,9 @@
"error": {
"failed": "An error occurred while removing the password from the PDF."
},
"tooltip": {
"description": "Removing password protection requires the password that was used to encrypt the PDF. This will decrypt the document, making it accessible without a password."
},
"results": {
"title": "Decrypted PDFs"
}

View File

@ -1740,6 +1740,9 @@
"error": {
"failed": "An error occurred while removing the password from the PDF."
},
"tooltip": {
"description": "Removing password protection requires the password that was used to encrypt the PDF. This will decrypt the document, making it accessible without a password."
},
"results": {
"title": "Decrypted PDFs"
}

View File

@ -0,0 +1,20 @@
import { useTranslation } from 'react-i18next';
import { TooltipContent } from '../../types/tips';
export const useRemovePasswordTips = (): TooltipContent => {
const { t } = useTranslation();
return {
header: {
title: t("removePassword.title", "Remove Password")
},
tips: [
{
description: t(
"removePassword.tooltip.description",
"Removing password protection requires the current password that was used to encrypt the PDF. This will decrypt the document, making it accessible without a password."
)
}
]
};
};

View File

@ -16,6 +16,7 @@ import RemovePasswordSettings from "../components/tools/removePassword/RemovePas
import { useRemovePasswordParameters } from "../hooks/tools/removePassword/useRemovePasswordParameters";
import { useRemovePasswordOperation } from "../hooks/tools/removePassword/useRemovePasswordOperation";
import { useRemovePasswordTips } from "../components/tooltips/useRemovePasswordTips";
import { BaseToolProps } from "../types/tool";
const RemovePassword = ({ onPreviewFile, onComplete, onError }: BaseToolProps) => {
@ -25,6 +26,7 @@ const RemovePassword = ({ onPreviewFile, onComplete, onError }: BaseToolProps) =
const removePasswordParams = useRemovePasswordParameters();
const removePasswordOperation = useRemovePasswordOperation();
const removePasswordTips = useRemovePasswordTips();
// Endpoint validation
const { enabled: endpointEnabled, loading: endpointLoading } = useEndpointEnabled(removePasswordParams.getEndpointName());
@ -104,6 +106,7 @@ const RemovePassword = ({ onPreviewFile, onComplete, onError }: BaseToolProps) =
isCompleted={passwordCollapsed}
onCollapsedClick={hasResults ? handleSettingsReset : undefined}
completedMessage={passwordCollapsed ? t('removePassword.password.completed', 'Password configured') : undefined}
tooltip={removePasswordTips}
>
<RemovePasswordSettings
parameters={removePasswordParams.parameters}