MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / PlatformProviderInternal

Function PlatformProviderInternal

docs/src/components/platformcontext.tsx:31–44  ·  view source on GitHub ↗
({ children }: { children: ReactNode })

Source from the content-addressed store, hash-verified

29}
30
31const PlatformProviderInternal = ({ children }: { children: ReactNode }) => {
32 const [platform, setPlatform] = useState<Platform>(getOS());
33
34 const setPlatformCallback = useCallback((newPlatform: Platform) => {
35 setPlatform(newPlatform);
36 localStorage.setItem("platform", newPlatform); // Store in localStorage
37 }, []);
38
39 return (
40 <PlatformContext.Provider value={{ platform, setPlatform: setPlatformCallback }}>
41 {children}
42 </PlatformContext.Provider>
43 );
44};
45
46export function PlatformProvider({ children }: { children: ReactNode }) {
47 return (

Callers

nothing calls this directly

Calls 2

getOSFunction · 0.85
setPlatformFunction · 0.50

Tested by

no test coverage detected