feat: cockpit

This commit is contained in:
OpenSquared
2026-07-23 21:09:37 +02:00
parent 9cf3086254
commit cfc33d1ee3
2 changed files with 118 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
import { useState, useEffect, useCallback, useMemo, useRef } from 'react'
import { useParams, useNavigate } from 'react-router-dom'
import { useParams, useNavigate, useSearchParams } from 'react-router-dom'
import {
Sparkles, RefreshCw, ChevronDown, TrendingUp, TrendingDown,
Minus, BarChart2, Clock, Calendar, AlertCircle,
@@ -1426,7 +1426,10 @@ export default function InstrumentDashboard({ instrumentIdProp, isVisible }: { i
const [loadingNarr, setLoadingNarr] = useState(false)
const [selectorOpen, setSelectorOpen] = useState(false)
const [selectedDate, setSelectedDate] = useState<string | null>(null)
const [tabUnder, setTabUnder] = useState<'counters' | 'analyse' | 'wavelets'>('counters')
const [searchParams] = useSearchParams()
// ?tab=wavelets lets other pages (e.g. Dashboard's Wavelets Signal card) deep-link
// straight into the Wavelets panel instead of always landing on Counters.
const [tabUnder, setTabUnder] = useState<'counters' | 'analyse' | 'wavelets'>(() => (searchParams.get('tab') === 'wavelets' ? 'wavelets' : 'counters'))
const [waveletLevels, setWaveletLevels] = useState(4)
const [waveletFamily, setWaveletFamily] = useState<'gmw' | 'morlet' | 'bump'>('gmw')
const [waveletMethod, setWaveletMethod] = useState<'cwt' | 'ssq'>('cwt')