import Container from "./components/UI/Container";
import Dashboard from "./pages/Dashboard";
import { Navigate, Route, Routes } from "react-router";
import FrontCamera from "./pages/FrontCamera";
import RearCamera from "./pages/RearCamera";
import SystemSettings from "./pages/SystemSettings";
import Session from "./pages/Session";
import { IntegrationsProvider } from "./context/providers/IntegrationsContextProvider";
import { AlertHitProvider } from "./context/providers/AlertHitProvider";
import { SoundProvider } from "react-sounds";
import SoundContextProvider from "./context/providers/SoundContextProvider";

function App() {
  return (
    <SoundContextProvider>
      <SoundProvider initialEnabled={true}>
        <IntegrationsProvider>
          <AlertHitProvider>
            <Routes>
              <Route path="/" element={<Container />}>
                <Route index element={<Dashboard />} />
                <Route path="a-camera-settings" element={<FrontCamera />} />
                <Route path="b-camera-settings" element={<RearCamera />} />
                <Route path="system-settings" element={<SystemSettings />} />
                <Route path="session-settings" element={<Session />} />
                <Route path="*" element={<Navigate to="/" replace />} />
              </Route>
            </Routes>
          </AlertHitProvider>
        </IntegrationsProvider>
      </SoundProvider>
    </SoundContextProvider>
  );
}

export default App;
