feat: afficher le % géolocalisé dans la barre de contrôles
ci/woodpecker/push/woodpecker Pipeline was successful

Ajoute un badge "XX% géo" à droite du bouton Flux/Heatmap dans
PeriodSelector, mis à jour à chaque frame d'animation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
syoul
2026-03-24 11:24:03 +01:00
parent 8e208d02ab
commit ffe09ea44a
2 changed files with 10 additions and 1 deletions
+7 -1
View File
@@ -7,6 +7,7 @@ interface PeriodSelectorProps {
onAnimate: () => void;
viewMode: 'heatmap' | 'flow';
onViewModeChange: (mode: 'heatmap' | 'flow') => void;
geoPercent?: number | null;
}
const PERIODS = [
@@ -17,7 +18,7 @@ const PERIODS = [
const PRESET_DAYS = new Set([1, 7, 30]);
export function PeriodSelector({ value, onChange, animationActive, onAnimate, viewMode, onViewModeChange }: PeriodSelectorProps) {
export function PeriodSelector({ value, onChange, animationActive, onAnimate, viewMode, onViewModeChange, geoPercent }: PeriodSelectorProps) {
const [customOpen, setCustomOpen] = useState(false);
const [inputVal, setInputVal] = useState('');
const inputRef = useRef<HTMLInputElement>(null);
@@ -124,6 +125,11 @@ export function PeriodSelector({ value, onChange, animationActive, onAnimate, vi
>
{viewMode === 'flow' ? '⊙ Heatmap' : '◉ Flux'}
</button>
{geoPercent != null && (
<span className="text-[10px] font-mono text-[#4b5563] px-1 shrink-0">
{geoPercent}%<span className="hidden sm:inline"> géo</span>
</span>
)}
</div>
);
}