import { AppContext } from "./AppContext";
import type {
  AppContextProviderProps,
  AppContextType,
} from "./AppContextTypes";

export function AppContextProvider<T, K>({
  children,
  jsBridge,
  appData,
}: AppContextProviderProps<T, K>) {
  const contextValue = {
    jsBridge,
    appData,
  } as AppContextType<T, K>;

  return (
    <AppContext.Provider value={contextValue}>{children}</AppContext.Provider>
  );
}
