import { useQuery } from '@tanstack/react-query'
import { dashboardService } from '../services/dashboardService'
import type { DashboardData } from '../domain/dashboard'

export function useSupplyDashboard() {
  return useQuery<DashboardData>({
    queryKey: ['supply', 'dashboard'],
    queryFn: () => dashboardService.getDashboardData(),
    staleTime: 30_000,
  })
}
