fix(SW-1111) refactor state of active hotel card and hotel pin
This commit is contained in:
15
stores/hotels-map.ts
Normal file
15
stores/hotels-map.ts
Normal 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 }),
|
||||
}))
|
||||
Reference in New Issue
Block a user