import React from 'react'; import { useTranslation } from 'react-i18next'; import logo from '../src/images/wifi.png'; import { Card } from './components/Card'; import './style.css'; /* List of languages that require RTL direction (alphabetic order). */ const RTL_LANGUAGES = ['ar', 'fa-IR']; function App() { const html = document.querySelector('html'); const { t, i18n } = useTranslation(); const changeLanguage = (language) => { html.style.direction = RTL_LANGUAGES.includes(language) ? 'rtl' : 'ltr'; i18n.changeLanguage(language); }; /* handle the edge case of the initial render requiring RTL direction */ if (RTL_LANGUAGES.includes(i18n.language)) { html.style.direction = 'rtl'; } return (
); } export default App;