From c48b117508e864484559e1bf4705b235082a22d1 Mon Sep 17 00:00:00 2001 From: Lilia Sviridova Date: Wed, 27 Nov 2024 16:19:00 +0200 Subject: [PATCH] Refactor code --- components/contentblocks/IndicatorGroupBlock.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/components/contentblocks/IndicatorGroupBlock.tsx b/components/contentblocks/IndicatorGroupBlock.tsx index f8a9fd47..fa04e24a 100644 --- a/components/contentblocks/IndicatorGroupBlock.tsx +++ b/components/contentblocks/IndicatorGroupBlock.tsx @@ -96,15 +96,12 @@ type Props = { // TODO: Format as list for a11y const IndicatorGroupBlock = ({ id = '', title, indicators }: Props) => { const t = useTranslations(); - - const displayHeader = title && title !== '-' ? title : t('indicators'); + const displayHeader = title === '-' ? null : title || t('indicators'); return ( - {displayHeader && displayHeader !== '-' ? ( - {displayHeader} - ) : null} + {displayHeader ? {displayHeader} : null} {indicators.map((item) => (