refactor: extract signals filter builder, add ESLint 10 config, fix low-hanging issues

This commit is contained in:
Sebastian Seedorf
2026-06-04 14:09:12 +02:00
parent cf9bb33ecb
commit 4b05f2968e
34 changed files with 2145 additions and 188 deletions

View File

@@ -1,11 +1,13 @@
'use client';
import React, { createContext, useCallback, useContext, useEffect, useState } from 'react';
import type { TimeRange, TimeMode, TriggeredAlert } from './types';
import { TIME_RANGE_MS } from './types';
import { checkAlerts } from './api';
import { buildReverseMap } from './localization';
import { TIME_RANGE_MS } from './types';
import type { LocaleMap, ReverseMap } from './localization';
import type { TimeRange, TimeMode, TriggeredAlert } from './types';
interface AppContextValue {
timeRange: TimeRange;
@@ -22,14 +24,12 @@ interface AppContextValue {
const AppContext = createContext<AppContextValue | null>(null);
export function AppProvider({
token: _token,
localeMap,
children,
}: {
token: string;
localeMap: LocaleMap;
children: React.ReactNode;
}) {
} & { token?: string }) {
const [timeRange, setTimeRange] = useState<TimeRange>('6h');
const [timeMode, setTimeMode] = useState<TimeMode>('real');
const [triggeredAlerts, setTriggeredAlerts] = useState<TriggeredAlert[]>([]);