

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

import { Toaster } from '@/components/ui/toaster';
import { ThemeProvider } from '@/contexts/ThemeContext';
import DatavenRoute from '@/routes/DatavenRoute';
import ProtectedRoute from '@/routes/ProtectedRoute';
import Login from '@/pages/auth/Login';
import Forgot from '@/pages/auth/forgot';
import Reset from '@/pages/auth/reset';
import { SignatureProvider } from './contexts/SignatureContext';


function App() {
  return (
    <ThemeProvider>
      <SignatureProvider>
        <Router>
          <Routes> 
            <Route path="/" element={<Login />} />
            <Route path="/forgot" element={<Forgot />} />
            <Route path="/reset" element={<Reset />} />

            <Route
              path="/home/*"
              element={
                <ProtectedRoute>
                  <DatavenRoute />
                </ProtectedRoute> 
              }
            />
            <Route path="*" element={<Login />} />
          </Routes>

          <Toaster toastOptions={{ className: "z-[9999]" }} />

        </Router>
      </SignatureProvider>
    </ThemeProvider>
  );
}

export default App;
