import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';

import Login from './pages/Login';
import Register from './pages/Register';

import { AuthProvider } from './auth/authProvider';
import { ProtectedRoute } from './auth/ProtectedRoute';
import Home from './pages/Home';
import Dateien from './pages/Dateien/Dateien';
import Mitglieder from './pages/Mitglieder/Mitglieder';
import Dashboard from './pages/Dashboard';
import Einstellungen from './pages/Einstellungen/Einstellungen';
// Import the global light theme CSS variables as default
import './assets/styles/light.css';

function App() {
    return (
        <AuthProvider>
            <Router>
                <Routes>
                    {/* Public route */}
                    <Route path="/login" element={<Login />} />
                    <Route path="/register" element={<Register />} />
                    <Route path="/" element={
                        <ProtectedRoute>
                            <Home />
                        </ProtectedRoute>
                    }>
                        <Route path="dashboard" element={<Dashboard />} />
                        <Route path="dateien" element={<Dateien />} />
                        <Route path="mitglieder" element={<Mitglieder />} />
                        <Route path="einstellungen" element={<Einstellungen />} />
                    </Route>
                </Routes>
            </Router>
        </AuthProvider>
    );
}

export default App;