feat: build production-ready wtr weather PWA

This commit is contained in:
zv
2026-06-01 18:43:56 +02:00
commit 840555f4f5
60 changed files with 9052 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
"use client";
import { useQuery } from "@tanstack/react-query";
import { fetchSynopStation, fetchSynopStations } from "@/lib/imgw-api";
import { QUERY_GC_TIME, QUERY_STALE_TIME } from "@/lib/constants";
export function useWeatherStations() {
return useQuery({
queryKey: ["synop-stations"],
queryFn: ({ signal }) => fetchSynopStations(signal),
staleTime: QUERY_STALE_TIME,
gcTime: QUERY_GC_TIME,
retry: 2,
});
}
export function useWeatherStation(id: string) {
return useQuery({
queryKey: ["synop-station", id],
queryFn: ({ signal }) => fetchSynopStation(id, signal),
staleTime: QUERY_STALE_TIME,
gcTime: QUERY_GC_TIME,
retry: 2,
enabled: Boolean(id),
});
}