From 4aba1827370761545eaa63835e14e53f34c24c62 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 14 Jan 2025 13:33:27 +0100 Subject: [PATCH] chore: extract to function --- .../DashboardsBar/InformationBlock/ActionsBar.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/DashboardsBar/InformationBlock/ActionsBar.js b/src/components/DashboardsBar/InformationBlock/ActionsBar.js index 3c7009557..b01f0ba07 100644 --- a/src/components/DashboardsBar/InformationBlock/ActionsBar.js +++ b/src/components/DashboardsBar/InformationBlock/ActionsBar.js @@ -186,15 +186,17 @@ const ActionsBar = ({ return } - let slideshowTooltipContent = null - if (!hasSlideshowItems) { - slideshowTooltipContent = i18n.t( - 'No dashboard items to show in slideshow' - ) - } else if (offline && !isCached) { - slideshowTooltipContent = i18n.t('Not available offline') + const getSlideshowTooltipContent = () => { + if (!hasSlideshowItems) { + return i18n.t('No dashboard items to show in slideshow') + } else if (offline && !isCached) { + return i18n.t('Not available offline') + } + return null } + const slideshowTooltipContent = getSlideshowTooltipContent() + return ( <>