// import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { BrowserRouter, Route, Routes } from "react-router";
import Login from './pages/Login.tsx';
import Previewer from './pages/Previewer.tsx';
import NotFound from './pages/NotFound.tsx';
import Home from './pages/Home.tsx';
import UploadModel from './pages/Upload3dmodel.tsx';
import ProtectedRoute from "./components/ProtectedRoute";
import { AuthProvider } from "./lib/AuthProvider";
import PrivateLayout from './layout/PrivateLayout.tsx';
import RootLayout from './layout/RootLayout.tsx';

createRoot(document.getElementById('root')!).render(
  <BrowserRouter basename="/visor3d">
    <AuthProvider>
      <RootLayout>
        <Routes>
          <Route path="/login" element={<Login />} />
          <Route path="/" element={<ProtectedRoute>
            <PrivateLayout>
              <Home />
            </PrivateLayout>
          </ProtectedRoute>} />
          <Route path="/previewer/:id" element={<ProtectedRoute>
            <PrivateLayout>
              <Previewer />
            </PrivateLayout>
          </ProtectedRoute>} />
          <Route path="/upload" element={<ProtectedRoute>
            <PrivateLayout>
              <UploadModel />
            </PrivateLayout>
          </ProtectedRoute>} />
          <Route path="*" element={<NotFound />} />
        </Routes>
      </RootLayout>
    </AuthProvider>
  </BrowserRouter >
);
