import React from 'react'
import { Routes, Route, Navigate } from "react-router-dom";

import { Dashboard } from "./Dashboard";
import { Login } from '../Pages/Login'
import { Register } from '../Pages/Register'
import { Home } from '../Pages/Home'
import { Puestos } from '../Pages/Puestos'
// import { Contras  } from '../Pages/Contras'
import { Contrasv2  as Contras } from '../Pages/ContrasV2'
import { Expedientes } from '../Pages/Expedientes'
import { Resultados } from '../Pages/Resultados'
import { Configuracion } from '../Pages/Configuracion'
import { Historial } from '../Pages/Historial'
import { Pruebas } from '../Pages/Pruebas'
import { PruebaNueva } from '../Pages/PruebaNueva'
import { PruebaAsignar } from '../Pages/PruebaAsignar'
import { NotFound } from '../Pages/404'
import { Profile } from '../Pages/Profile'
import { RestorePassword } from '../Pages/RestorePassword'

import RequireAuth from '../Components/PrivateRoute'

export default function MyRoutes () {

    return(
        <Routes>

            <Route path="/" element={<Navigate to='/login'/>} />
            <Route path="login" element={<Login/>} />
            <Route path="password/recuperar" element={<RestorePassword/>} />
            <Route path="register" element={<Register/>} />
            <Route 
                path="dashboard" 
                element={
                    <RequireAuth>
                        <Dashboard/>
                    </RequireAuth>
                }
            >
                <Route path="home" element={<Home/>} />
                <Route path="puestos" element={<Puestos/>} />
                <Route path="perfil" element={<Profile/>} />
                <Route path="contrasenas" element={<Contras/>} />
                <Route path="expedientes" element={<Expedientes/>} />
                <Route path="resultados" element={<Resultados/>} />
                <Route path="configuraciones" element={<Configuracion/>} />
                <Route path="historial" element={<Historial/>} />
                <Route path="pruebas/listar" element={<Pruebas/>} />
                <Route path="pruebas/crear" element={<PruebaNueva/>} />
                <Route path="pruebas/aplicar" element={<PruebaAsignar/>} />
            </Route>
            <Route path="*" element={<NotFound/>}/>

        </Routes>
    )
}

