From 5eea1f9c895a9de505396931cedba4440d8a071b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Tue, 29 Mar 2022 17:44:45 +0200 Subject: [PATCH] Refacto de CustomTooltip --- site/source/pages/Stats/SatisfactionChart.tsx | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/site/source/pages/Stats/SatisfactionChart.tsx b/site/source/pages/Stats/SatisfactionChart.tsx index 47b6f6702..2e0207574 100644 --- a/site/source/pages/Stats/SatisfactionChart.tsx +++ b/site/source/pages/Stats/SatisfactionChart.tsx @@ -50,7 +50,7 @@ export default function SatisfactionChart({ data }: SatisfactionChartProps) { - } /> + {SatisfactionStyle.map(([level, { emoji, color }]) => ( { - if (!active || !payload) { + const data = (payload && payload.length > 0 && payload[0].payload) || null + + if (!active || !data) { return null } - const data = payload[0].payload return (