import { createContext, PropsWithChildren } from "react";
import { WelcomeApi } from "../types/shared-types";

export const WelcomeApiContext = createContext<WelcomeApi>({} as WelcomeApi);

export function WithWelcomeApiContext({
	children,
	api,
}: PropsWithChildren<{ api: WelcomeApi }>): React.JSX.Element {
	return (
		<WelcomeApiContext.Provider value={api}>
			{children}
		</WelcomeApiContext.Provider>
	);
}
