import { BrowserRouter, Routes, Route } from "react-router-dom";
import UploadPage from "./user/UploadPage";
import AdminLayout from "./admin/AdminLayout";
import Dashboard from "./admin/Dashboard";
import Users from "./admin/Users";
import Security from "./admin/Security";
import Anomalies from "./admin/Anomalies";
import Login from "./auth/Login";
import Register from "./auth/Register";
import { ThemeProvider } from "./theme/ThemeContext";

export default function App() {
  return (
    <ThemeProvider>
      <BrowserRouter>
        <Routes>
          <Route path="/login" element={<Login />} />
          <Route path="/register" element={<Register />} />

          <Route path="/" element={<UploadPage />} />

          <Route path="/admin" element={<AdminLayout />}>
            <Route index element={<Dashboard />} />
            <Route path="users" element={<Users />} />
            <Route path="security" element={<Security />} />
            <Route path="anomalies" element={<Anomalies />} />
          </Route>
        </Routes>
      </BrowserRouter>
    </ThemeProvider>
  );
}
