import { create } from 'zustand' type SharedTransitionState = { byLocationKey: Record setForLocationKey: (locationKey: string, sharedId: string) => void clearForLocationKey: (locationKey: string) => void } export const useSharedTransitionStore = create (set => ({ byLocationKey: { }, setForLocationKey: (locationKey, sharedId) => set (state => ({ byLocationKey: { ...state.byLocationKey, [locationKey]: sharedId } })), clearForLocationKey: (locationKey) => set (state => { const next = { ...state.byLocationKey } delete next[locationKey] return { byLocationKey: next }}) }))