Skip to content

Commit

Permalink
chore: extract to function
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Jan 14, 2025
1 parent b9f5ded commit 4aba182
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/DashboardsBar/InformationBlock/ActionsBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,17 @@ const ActionsBar = ({
return <Redirect to={redirectUrl} />
}

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 (
<>
<div className={classes.actions}>
Expand Down

0 comments on commit 4aba182

Please sign in to comment.