import React, { useEffect } from "react"; import { Link, withRouter } from "react-router-dom"; import "./Navbar.css"; import logo from "./logo2.png"; import Cookies from "js-cookie"; /* eslint-disable jsx-a11y/anchor-is-valid */ import { useTranslation } from "react-i18next"; import i18next from "i18next"; const langauges = [ { code: "fr", name: "Français", country_code: "fr", }, { code: "en", name: "English", country_code: "gb", }, ]; const Navbar = () => { const currentLanguageCode = Cookies.get("i18next") || "en"; const currentLanguage = langauges.find( (lang) => lang.code === currentLanguageCode ); const { t } = useTranslation(); useEffect(() => { document.body.dir = currentLanguage.dir || "ltr"; }, [currentLanguage]); return ( /* Nav Bar */
); }; export default withRouter(Navbar);