mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
18 lines
522 B
TypeScript
18 lines
522 B
TypeScript
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>
|
|
);
|
|
} |