From 430ddb6015f4baa22a259d84969da8471b11f149 Mon Sep 17 00:00:00 2001 From: Adrien Delmastro Date: Thu, 12 Feb 2026 20:41:14 +0100 Subject: [PATCH 1/2] [FIX] - add loader + tooltip fix --- pwa/app/components/tabs/temporal.tsx | 33 +++++++++++++++++++++++----- pwa/app/globals.css | 18 +++++++++++++++ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/pwa/app/components/tabs/temporal.tsx b/pwa/app/components/tabs/temporal.tsx index 7165063..60befb8 100644 --- a/pwa/app/components/tabs/temporal.tsx +++ b/pwa/app/components/tabs/temporal.tsx @@ -5,6 +5,7 @@ import { LineChart, Line, XAxis, YAxis, Tooltip, Legend, ResponsiveContainer, Ca import { getTimeSeries, type TimeSeriesData } from '../../services/temporal.services' import { TAX_TYPES, YEARS, COLORS } from '../../constants' import ErrorDiv from '../molecules/ErrorDiv' +import Loader from '../molecules/Loader' interface TemporalProps { regions: string[] @@ -153,21 +154,41 @@ export default function Temporal({ regions }: TemporalProps) { )} + {loading && } + {error && } - {!error && chartData.length > 0 && ( + {!loading && !error && chartData.length > 0 && ( `${v}%`} /> { + if (!payload || payload.length === 0) return null + return ( +
+

{label}

+ {[...payload].sort((a, b) => Number(b.value) - Number(a.value)).map(item => ( +

+ {item.name} : {item.value}% +

+ ))} +
+ ) }} - formatter={(value, name) => [`${value}%`, name]} + wrapperStyle={{ zIndex: 10, pointerEvents: 'auto' }} /> Date: Thu, 12 Feb 2026 20:42:01 +0100 Subject: [PATCH 2/2] [FIX] - add loader on points --- pwa/app/components/molecules/Loader.tsx | 7 +++++++ pwa/app/components/tabs/points.tsx | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 pwa/app/components/molecules/Loader.tsx diff --git a/pwa/app/components/molecules/Loader.tsx b/pwa/app/components/molecules/Loader.tsx new file mode 100644 index 0000000..38c38e7 --- /dev/null +++ b/pwa/app/components/molecules/Loader.tsx @@ -0,0 +1,7 @@ +export default function Loader() { + return ( +
+
+
+ ) +} diff --git a/pwa/app/components/tabs/points.tsx b/pwa/app/components/tabs/points.tsx index 62b9146..654b5f8 100644 --- a/pwa/app/components/tabs/points.tsx +++ b/pwa/app/components/tabs/points.tsx @@ -8,6 +8,7 @@ ChartJS.register(LinearScale, PointElement, Tooltip, Legend) import { searchDepartments, getCorrelation, type Department, type CorrelationPoint } from '../../services/points.services' import { TAX_TYPES, YEARS } from '../../constants' import ErrorDiv from '../molecules/ErrorDiv' +import Loader from '../molecules/Loader' export default function Points() { // Department search autocomplete results from API @@ -235,9 +236,11 @@ export default function Points() {
+ {loading && } + {error && } - {!error && data.length > 0 && ( + {!loading && !error && data.length > 0 && ( <>

-- GitLab