import { LocalStorage } from '@vegaprotocol/react-helpers'; import create from 'zustand'; interface GlobalStore { networkSwitcherDialog: boolean; landingDialog: boolean; riskNoticeDialog: boolean; marketId: string | null; update: (store: Partial>) => void; } interface PageTitleStore { pageTitle: string | null; updateTitle: (title: string) => void; } export const useGlobalStore = create((set) => ({ networkSwitcherDialog: false, landingDialog: false, riskNoticeDialog: false, marketId: LocalStorage.getItem('marketId') || null, update: (state) => { set(state); if (state.marketId) { LocalStorage.setItem('marketId', state.marketId); } }, })); export const usePageTitleStore = create((set) => ({ pageTitle: null, updateTitle: (title: string) => set({ pageTitle: title }), }));