refactor: extract signals filter builder, add ESLint 10 config, fix low-hanging issues
This commit is contained in:
@@ -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[]>([]);
|
||||
|
||||
Reference in New Issue
Block a user