From 3143338a0760498255f082868f716520d396b0f3 Mon Sep 17 00:00:00 2001 From: Shane Loeffler Date: Thu, 4 Jan 2024 10:53:35 -0600 Subject: [PATCH] handle error state --- components/charts/detail-charts.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/components/charts/detail-charts.js b/components/charts/detail-charts.js index c0c4150..3a18955 100644 --- a/components/charts/detail-charts.js +++ b/components/charts/detail-charts.js @@ -38,9 +38,10 @@ const DetailCharts = ({ issued, retired, isLoading, error }) => { } } const chartColumn = (isRetired) => { - const categoryKeys = isLoading - ? previousCategories - : Object.keys(LABELS.category).filter((l) => Boolean(issued.mapping[l])) + const categoryKeys = + isLoading || error + ? previousCategories + : Object.keys(LABELS.category).filter((l) => Boolean(issued.mapping[l])) return ( { mb: 1, }} > - {isLoading ? ( + {isLoading || error ? ( { - {isLoading + {isLoading || error ? '-' : formatValue( isRetired ? retired.mapping[l] : issued.mapping[l]