import { create } from 'zustand' /** * Whether the page holds unsaved changes the user would lose by following a * link of the shell. Armed by useLeaveGuard; read by AppLayout, which asks * before an in-app link click while it is armed. */ interface LeaveGuardState { armed: boolean arm: (armed: boolean) => void } export const useLeaveGuardStore = create((set) => ({ armed: false, arm: (armed) => set({ armed }), }))