import { useQuery } from '@tanstack/react-query'; import { api } from '../api'; export function useWeather() { return useQuery({ queryKey: ['weather'], queryFn: () => api.weather.get(), staleTime: 15 * 60_000, refetchInterval: 15 * 60_000, }); } export function useForecast() { return useQuery({ queryKey: ['forecast'], queryFn: () => api.weather.forecast(), staleTime: 3 * 60 * 60_000, }); }