({ children }: { children: ReactNode })
| 29 | } |
| 30 | |
| 31 | const 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 | |
| 46 | export function PlatformProvider({ children }: { children: ReactNode }) { |
| 47 | return ( |
nothing calls this directly
no test coverage detected