@@ -346,77 +346,86 @@ export function Component() {
346346 triggerExportStart ,
347347 projectListResponse ?. count ,
348348 ] ) ;
349-
349+ const showCard1 = activeNSCount > 0 || targetedPopulation > 0 ;
350+ const showCard2 = filteredProjectList . length > 0 || programmeTypeStats . length > 0 ;
351+ const showCard3 = ongoingProjectBudget > 0 || projectStatusTypeStats . length > 0 ;
352+ const showCardsSection = showCard1 || showCard2 || showCard3 ;
350353 return (
351354 < div className = { styles . countryThreeWProjects } >
352355 { projectListPending && < BlockLoading /> }
353- { ! projectListPending && (
356+ { ! projectListPending && showCardsSection && (
354357 < div className = { styles . keyFigureCardList } >
355- < div className = { styles . keyFigureCard } >
356- < KeyFigure
357- className = { styles . keyFigure }
358- value = { activeNSCount }
359- label = { strings . activeDeploymentsTitle }
360- labelClassName = { styles . keyFigureDescription }
361- />
362- < div className = { styles . separator } />
363- < KeyFigure
364- className = { styles . keyFigure }
365- value = { targetedPopulation }
366- label = { strings . targetedPopulationTitle }
367- labelClassName = { styles . keyFigureDescription }
368- compactValue
369- />
370- </ div >
371- < div className = { styles . keyFigureCard } >
372- < KeyFigure
373- className = { styles . keyFigure }
374- value = { projectList . length }
375- label = { strings . totalProjectsTitle }
376- labelClassName = { styles . keyFigureDescription }
377- />
378- < div className = { styles . separator } />
379- < Container
380- heading = { strings . programmeType }
381- headingLevel = { 5 }
382- >
383- < PieChart
384- className = { styles . pieChart }
385- data = { programmeTypeStats }
386- valueSelector = { numericValueSelector }
387- labelSelector = { stringLabelSelector }
388- keySelector = { stringLabelSelector }
389- colors = { primaryRedColorShades }
390- pieRadius = { 40 }
391- chartPadding = { 10 }
358+ { showCard1 && (
359+ < div className = { styles . keyFigureCard } >
360+ < KeyFigure
361+ className = { styles . keyFigure }
362+ value = { activeNSCount }
363+ label = { strings . activeDeploymentsTitle }
364+ labelClassName = { styles . keyFigureDescription }
392365 />
393- </ Container >
394- </ div >
395- < div className = { styles . keyFigureCard } >
396- < KeyFigure
397- className = { styles . keyFigure }
398- value = { ongoingProjectBudget }
399- label = { strings . ongoingProjectBudgetTitle }
400- labelClassName = { styles . keyFigureDescription }
401- compactValue
402- />
403- < div className = { styles . separator } />
404- < Container
405- heading = { strings . projectStatus }
406- headingLevel = { 5 }
407- >
408- < PieChart
409- className = { styles . pieChart }
410- data = { projectStatusTypeStats }
411- valueSelector = { numericValueSelector }
412- labelSelector = { stringLabelSelector }
413- keySelector = { stringLabelSelector }
414- colors = { primaryRedColorShades }
415- pieRadius = { 40 }
416- chartPadding = { 10 }
366+ < div className = { styles . separator } />
367+ < KeyFigure
368+ className = { styles . keyFigure }
369+ value = { targetedPopulation }
370+ label = { strings . targetedPopulationTitle }
371+ labelClassName = { styles . keyFigureDescription }
372+ compactValue
417373 />
418- </ Container >
419- </ div >
374+ </ div >
375+ ) }
376+ { showCard2 && (
377+ < div className = { styles . keyFigureCard } >
378+ < KeyFigure
379+ className = { styles . keyFigure }
380+ value = { filteredProjectList . length }
381+ label = { strings . totalProjectsTitle }
382+ labelClassName = { styles . keyFigureDescription }
383+ />
384+ < div className = { styles . separator } />
385+ < Container
386+ heading = { strings . programmeType }
387+ headingLevel = { 5 }
388+ >
389+ < PieChart
390+ className = { styles . pieChart }
391+ data = { programmeTypeStats }
392+ valueSelector = { numericValueSelector }
393+ labelSelector = { stringLabelSelector }
394+ keySelector = { stringLabelSelector }
395+ colors = { primaryRedColorShades }
396+ pieRadius = { 40 }
397+ chartPadding = { 10 }
398+ />
399+ </ Container >
400+ </ div >
401+ ) }
402+ { showCard3 && (
403+ < div className = { styles . keyFigureCard } >
404+ < KeyFigure
405+ className = { styles . keyFigure }
406+ value = { ongoingProjectBudget }
407+ label = { strings . ongoingProjectBudgetTitle }
408+ labelClassName = { styles . keyFigureDescription }
409+ compactValue
410+ />
411+ < div className = { styles . separator } />
412+ < Container
413+ heading = { strings . projectStatus }
414+ headingLevel = { 5 }
415+ >
416+ < PieChart
417+ className = { styles . pieChart }
418+ data = { projectStatusTypeStats }
419+ valueSelector = { numericValueSelector }
420+ labelSelector = { stringLabelSelector }
421+ keySelector = { stringLabelSelector }
422+ colors = { primaryRedColorShades }
423+ pieRadius = { 40 }
424+ chartPadding = { 10 }
425+ />
426+ </ Container >
427+ </ div >
428+ ) }
420429 </ div >
421430 ) }
422431 < Container
0 commit comments