From 687dc2bca252bec6dad2bd5e64ef27834084e8ac Mon Sep 17 00:00:00 2001 From: Christophe Vila Date: Mon, 27 Jul 2026 09:59:32 +0200 Subject: [PATCH] refactor(frontend): migrate Analysis.tsx to the banner system --- frontend/src/pages/Analysis.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/Analysis.tsx b/frontend/src/pages/Analysis.tsx index 1510f69..6c3c2f4 100644 --- a/frontend/src/pages/Analysis.tsx +++ b/frontend/src/pages/Analysis.tsx @@ -1,5 +1,6 @@ import { useEffect, useState } from "react"; import { api } from "../api/client"; +import { showError } from "../banner"; import { ProgressionChart } from "../components/charts/ProgressionChart"; import type { ProgressionMetric, ProgressionPoint, WorkoutKind } from "../types/api"; @@ -18,7 +19,6 @@ export function Analysis() { const [metric, setMetric] = useState("pace"); const [points, setPoints] = useState([]); const [loading, setLoading] = useState(false); - const [error, setError] = useState(null); useEffect(() => { api @@ -27,17 +27,16 @@ export function Analysis() { setKinds(k); if (k.length > 0) setSelectedKindId(k[0].ID); }) - .catch((e) => setError(String(e))); + .catch((e) => showError(String(e))); }, []); useEffect(() => { if (selectedKindId == null) return; setLoading(true); - setError(null); api .progression(selectedKindId, metric) .then(setPoints) - .catch((e) => setError(String(e))) + .catch((e) => showError(String(e))) .finally(() => setLoading(false)); }, [selectedKindId, metric]); @@ -77,7 +76,6 @@ export function Analysis() { - {error &&

{error}

} {loading ?

Loading...

: } )}