feat: new cockpit

This commit is contained in:
OpenSquared
2026-07-14 12:17:15 +02:00
parent ad07c8d886
commit 09b9efeda7
2 changed files with 56 additions and 28 deletions

View File

@@ -102,10 +102,10 @@ export interface FFEvent {
impact: 'high' | 'medium' | 'low'; event_name: string
actual_value: number | null; forecast_value: number | null; previous_value: number | null
}
export const useEcoCalendar = (params: { period?: string; limit?: number } = {}) =>
export const useEcoCalendar = (params: { period?: string; limit?: number; impacts?: string } = {}) =>
useQuery<{ events: FFEvent[] }>({
queryKey: ['eco-calendar', params],
queryFn: () => api.get('/eco/calendar', { params: { period: 'recent', limit: 30, ...params } }).then(r => r.data),
queryFn: () => api.get('/eco/calendar', { params: { period: 'recent', limit: 50, impacts: 'high,medium', ...params } }).then(r => r.data),
staleTime: 5 * 60_000,
})