MVP Debugger UI (#2888)

This commit is contained in:
Jonathan Dobson
2025-07-07 22:30:33 -04:00
committed by GitHub
parent d63053835f
commit acbdb15265
65 changed files with 2071 additions and 1022 deletions

View File

@@ -0,0 +1,30 @@
import React, { createContext, useMemo } from "react";
import { useLocation } from "react-router-dom";
function useIsDebugMode() {
const location = useLocation();
return useMemo(
() => location.pathname.includes("debug"),
[location.pathname],
);
}
export type DebugStoreContextType = {
isDebugMode: boolean;
};
export const DebugStoreContext = createContext<
DebugStoreContextType | undefined
>(undefined);
export const DebugStoreProvider: React.FC<{ children: React.ReactNode }> = ({
children,
}) => {
const isDebugMode = useIsDebugMode();
return (
<DebugStoreContext.Provider value={{ isDebugMode }}>
{children}
</DebugStoreContext.Provider>
);
};