Abstract WebContainer into "JSRuntime" type

This commit is contained in:
Alex Gleason committed 2025-07-20 16:21:49 -05:00
1 parent e0053af20a
commit 1ab9763302
8 files changed
+316 -102

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import { ReactNode } from 'react';
import { JSRuntimeContext, type JSRuntimeContextType } from '@/contexts/JSRuntimeContext';
import type { JSRuntime } from '@/lib/JSRuntime';
interface JSRuntimeProviderProps {
children: ReactNode;
runtime: JSRuntime;
}
export function JSRuntimeProvider({ children, runtime }: JSRuntimeProviderProps) {
const contextValue: JSRuntimeContextType = { runtime };
return (
<JSRuntimeContext.Provider value={contextValue}>
{children}
</JSRuntimeContext.Provider>
);
}