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

export const WatermarkApiContext = createContext<WatermarkApi>(
	{} as WatermarkApi
);

export function WithWatermarkApiContext({
	children,
	api,
}: PropsWithChildren<{ api: WatermarkApi }>): React.JSX.Element {
	return (
		<WatermarkApiContext.Provider value={api}>
			{children}
		</WatermarkApiContext.Provider>
	);
}
