import { create } from 'zustand'; /** * Transient cross-component instruction: `lib/notifications/push.ts` lives outside React (it reacts * to raw SDK topic events, same as topics.ts itself) and has no way to call `useNavigate()` directly * when a desktop Notification is clicked. Matches this codebase's established pattern for exactly * this shape of problem (stores/calls.ts, stores/messageJump.ts) rather than threading a navigate * callback down into a non-React module. */ interface NotificationNavState { pendingTopic: string | null; requestNavigate: (topic: string) => void; clear: () => void; } export const useNotificationNavStore = create((set) => ({ pendingTopic: null, requestNavigate: (topic) => set({ pendingTopic: topic }), clear: () => set({ pendingTopic: null }), }));