import { create } from "zustand"; import type { Point } from "@/types/api"; type Nullable = T | null; interface AppState { userLocation: Nullable; locationError: Nullable; isRequestingLocation: boolean; setUserLocation: (location: Nullable) => void; setLocationError: (error: Nullable) => void; setIsRequestingLocation: (isRequesting: boolean) => void; } export const useAppStore = create(set => ({ userLocation: null, locationError: null, isRequestingLocation: false, setUserLocation: userLocation => set({ userLocation }), setLocationError: locationError => set({ locationError }), setIsRequestingLocation: isRequestingLocation => set({ isRequestingLocation }), }));