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 { NPEDUserProvider } from "./context/providers/NPEDUserContextProvider";
import { AlertHitProvider } from "./context/providers/AlertHitProvider";
import { SoundProvider } from "react-sounds";

function App() {
  return (
    <SoundProvider initialEnabled={true}>
      <NPEDUserProvider>
        <AlertHitProvider>
          <Routes>
            <Route path="/" element={<Container />}>
              <Route index element={<Dashboard />} />
              <Route path="camera-settings" element={<FrontCamera />} />
              <Route path="rear-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>
      </NPEDUserProvider>
    </SoundProvider>
  );
}

export default App;
