import React, {
	type Dispatch,
	type SetStateAction,
	useState,
	type ReactNode,
} from "react";

type BoosterItem = Record<string, boolean>;

export const BoosterContext = React.createContext<{
	boosters: BoosterItem;
	setBoosters: Dispatch<SetStateAction<Record<string, boolean>>>;
}>({ boosters: {}, setBoosters: () => {} });

export const BoosterProvider = ({ children }: { children: ReactNode }) => {
	const [value, setValue] = useState<Record<string, boolean>>({});
	return (
		<BoosterContext.Provider value={{ boosters: value, setBoosters: setValue }}>
			{children}
		</BoosterContext.Provider>
	);
};
