All files / src App.js

75% Statements 3/4
100% Branches 0/0
50% Functions 1/2
75% Lines 3/4

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65                                    1x                 1x                               11x                                          
import React from 'react';
import {Route, Routes} from 'react-router-dom';
import Home from './pages/Home';
import Experience from './pages/Experience';
import Projects from './pages/Projects';
import Header from './components/ui/Header';
import Footer from './components/ui/Footer';
import translationEN from "./locales/en/translation.json";
import translationIT from "./locales/it/translation.json";
import {initReactI18next} from "react-i18next";
import i18n from "i18next";
import CookieBanner from "./pages/CookieBanner";
import Privacy from "./pages/Privacy";
import CookiePolicy from "./pages/CookiePolicy";
import Courses from "./pages/Courses";
import Trading from "./pages/Trading";
import Testimonials from "./pages/Testimonials";
 
const resources = {
    en: {
        translation: translationEN,
    },
    it: {
        translation: translationIT,
    }
};
 
i18n.use(initReactI18next).init({
    resources,
    lng: "en",
    fallbackLng: "en",
    interpolation: {
        escapeValue: false,
    }
}).catch(error => {
    console.error('Failed to init i18n:', error);
});
 
/**
 * @file Entry point of the application.
 * @description This file initializes the React application and mounts it to the DOM.
 */
export default function App() {
    return (
        <div
            className="min-h-screen flex flex-col bg-gray-100 text-gray-900 dark:bg-gray-900 dark:text-white transition-colors duration-300">
            <Header/>
            <main className="flex-grow">
                <Routes>
                    <Route path="/" element={<Home/>}/>
                    <Route path="/experience" element={<Experience/>}/>
                    <Route path="/projects" element={<Projects/>}/>
                    <Route path="/courses" element={<Courses/>}/>
                    <Route path="/trading" element={<Trading/>}/>
                    <Route path="/testimonials" element={<Testimonials/>}/>
                    <Route path="/privacy" element={<Privacy/>}/>
                    <Route path="/cookie-policy" element={<CookiePolicy/>}/>
                </Routes>
            </main>
            <Footer/>
            <CookieBanner/>
        </div>
    );
}