import { Routes, Route, BrowserRouter as Router } from 'react-router-dom';
import { Toaster } from 'react-hot-toast';
import Home from './pages/Home';
import { Layout } from './layout/Layout';
import { useTheme } from './context/ThemeContext';

function App() {
    const { theme } = useTheme();

    return (
        <Router>
            <Layout>
                <Routes>
                    <Route path="/" element={<Home />} />
                    <Route path="/NIF" />
                    <Route path="/NISS" />
                    <Route path="/CC" />
                </Routes>
                <Toaster position="top-right"
                    toastOptions={{
                        style: {
                            background: theme === 'dark' ? '#1f2937' : '#fff',
                            color: theme === 'dark' ? '#fff' : '#000',
                        },
                    }}
                    theme={theme} />
            </Layout>
        </Router>
    );
}

export default App;