import { createRoot } from 'react-dom/client';
import './index.css';
import Home from './Home.tsx';
import Login from './pages/login.tsx'
import Copylink from './pages/copylink.tsx';
import Admin from './pages/admin.tsx';

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

createRoot(document.getElementById('root')!).render(
  <Router>
          <Routes>
              <Route
                path='/home'
                element={<Home />}
              />
              <Route
                path='/login'
                element={<Login />}
              />
              <Route
                path='/admin'
                element={<Admin />}
              />
              <Route
                path='/link/:id'
                element={<Copylink />}
              />
              <Route
                path='*'
                element={<Navigate to={"/home"} />}
              />
          </Routes>
      </Router>,
)
