import { createContext, useContext, useMemo, useState, type ReactNode } from "react"; const SetupWizardSidebarContext = createContext<{ active: boolean; setActive: (active: boolean) => void; target: HTMLDivElement | null; setTarget: (target: HTMLDivElement | null) => void; } | null>(null); /** Keeps setup navigation owned by the form while rendering it in the shell. */ export function SetupWizardSidebarProvider({ children }: { children: ReactNode }) { const [active, setActive] = useState(false); const [target, setTarget] = useState(null); const value = useMemo(() => ({ target, setTarget, active, setActive }), [target, active]); return {children}; } export function useSetupWizardSidebar() { return useContext(SetupWizardSidebarContext); }