import { useQuery } from '@tanstack/react-query';
import { dashboardApi } from '../api/dashboard.api';

export function useDashboardStats() {
  return useQuery({
    queryKey: ['dashboard', 'stats'],
    queryFn: () => dashboardApi.getStats(),
    refetchInterval: 30000,
    staleTime: 10000,
  });
}

export function useRealtimeData() {
  return useQuery({
    queryKey: ['dashboard', 'realtime'],
    queryFn: () => dashboardApi.getRealtimeData(),
    refetchInterval: 5000,
    staleTime: 3000,
  });
}
