From 01ad2738a2ebc447c7d2f7dc11b803b699f7ac0b Mon Sep 17 00:00:00 2001 From: Harshith Mohan <26010946+harshithmohan@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:15:46 +0530 Subject: [PATCH] Add tooltips to renamer status icons (#978) --- src/pages/utilities/Renamer.tsx | 45 +++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/src/pages/utilities/Renamer.tsx b/src/pages/utilities/Renamer.tsx index 3e001e63d..445aaf029 100644 --- a/src/pages/utilities/Renamer.tsx +++ b/src/pages/utilities/Renamer.tsx @@ -138,27 +138,34 @@ const getResultColumn = ( } as UtilityHeaderType); const getStatusIcon = (result?: RenamerResultType) => { - if (!result) { - return ; + let icon = mdiHelpCircleOutline; + let className = ''; + let tooltip = ''; + + if (result?.ErrorMessage) { + icon = mdiCloseCircleOutline; + className = 'text-panel-text-danger'; + tooltip = 'Rename/preview failed!'; + } else if (result?.IsSuccess && result?.IsPreview) { + icon = mdiAlertCircleOutline; + className = 'text-panel-text-warning'; + tooltip = 'Rename pending!'; + } else if (result?.IsSuccess) { + icon = mdiCheckCircleOutline; + className = 'text-panel-text-important'; + tooltip = 'Rename successful!'; } - if (result.ErrorMessage) { - return ; - } - - if (result.IsSuccess && result.IsPreview && !result.AbsolutePath) { - return ; - } - - if (result.IsSuccess && result.IsPreview) { - return ; - } - - if (result.IsSuccess) { - return ; - } - - return ; + return ( + + ); }; const getStatusColumn = (renameResults: Record) => ({