import { createContext, useContext } from "react";
import { OnboardSessionService } from "@/services/onboard";

export const OnboardProviderContext = createContext<OnboardSessionService>(
	new OnboardSessionService(),
);

export const useOnboard = () => {
	const context = useContext(OnboardProviderContext);
	if (context === undefined) {
		throw new Error("useOnboard must be used within a OnboardProvider");
	}
	return context;
};
