diff --git a/frontend/src/containers/map/sidebar/main-panel/panels/details/widgets/marine-conservation/index.tsx b/frontend/src/containers/map/sidebar/main-panel/panels/details/widgets/marine-conservation/index.tsx index f6de2341..177a4372 100644 --- a/frontend/src/containers/map/sidebar/main-panel/panels/details/widgets/marine-conservation/index.tsx +++ b/frontend/src/containers/map/sidebar/main-panel/panels/details/widgets/marine-conservation/index.tsx @@ -155,11 +155,24 @@ const MarineConservationWidget: FCWithMessages = return data; }, [location, aggregatedData]); + const noData = useMemo(() => { + if (!chartData.length) { + return true; + } + + const emptyValues = chartData.every((d) => d.percentage === 0); + if (emptyValues) { + return true; + } + + return false; + }, [chartData]); + return ( { + if (!chartData.length) { + return true; + } + + const emptyValues = chartData.every((d) => d.percentage === 0); + if (emptyValues) { + return true; + } + + return false; + }, [chartData]); + return (