import React from 'react';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { SettingsProvider } from './context/SettingsContext';
import Layout from './components/Layout';
import Dashboard from './pages/Dashboard';
import DockerManager from './pages/DockerManager';
import Settings from './pages/Settings';

import History from './pages/History';

import DockerAuth from './components/DockerAuth';

function App() {
    return (
        <SettingsProvider>
            <BrowserRouter>
                <Routes>
                    <Route path="/" element={<Layout />}>
                        <Route index element={<Dashboard />} />
                        <Route path="history" element={<History />} />
                        <Route path="docker" element={
                            <DockerAuth>
                                <DockerManager />
                            </DockerAuth>
                        } />
                        <Route path="settings" element={<Settings />} />
                    </Route>
                </Routes>
            </BrowserRouter>
        </SettingsProvider>
    );
}

export default App;
