import { createContext, useContext, useState } from "react";

export const LanguageContext = createContext({
	language: "FR",
	changeLanguage: () => {},
});

export function LanguageContextProvider({ children }) {
	const [language, setLanguage] = useState("fr");

	function changeLanguage() {
		if (language === "FR") {
			setLanguage("EN");
		} else {
			setLanguage("EN");
		}
	}
	return <LanguageContext.Provider value={{ language, changeLanguage }}>{children}</LanguageContext.Provider>;
}