import { create } from 'zustand';
import type { WeatherSnapshot } from '@interfaces/weather/WeatherInterface';

export type { WeatherSnapshot };

interface WeatherSnapshotStore {
  snapshot: WeatherSnapshot | null;
  setSnapshot: (data: WeatherSnapshot) => void;
  clearSnapshot: () => void;
}

export const useWeatherSnapshotStore = create<WeatherSnapshotStore>((set) => ({
  snapshot: null,
  setSnapshot: (data) => set({ snapshot: data }),
  clearSnapshot: () => set({ snapshot: null }),
}));
