fix(SW-1111) refactor state of active hotel card and hotel pin

This commit is contained in:
Pontus Dreij
2024-12-09 16:49:15 +01:00
parent 7f50d34431
commit 15c5afc43a
15 changed files with 108 additions and 115 deletions

15
stores/hotels-map.ts Normal file
View File

@@ -0,0 +1,15 @@
import { create } from "zustand"
interface HotelsMapState {
activeHotelCard: string | null
activeHotelPin: string | null
setActiveHotelCard: (hotelCard: string | null) => void
setActiveHotelPin: (hotelPin: string | null) => void
}
export const useHotelsMapStore = create<HotelsMapState>((set) => ({
activeHotelCard: null,
activeHotelPin: null,
setActiveHotelCard: (hotelCard) => set({ activeHotelCard: hotelCard }),
setActiveHotelPin: (hotelPin) => set({ activeHotelPin: hotelPin }),
}))