import { Route, Routes, Navigate } from "react-router-dom";
import { RouteHandler } from "./routes";
import { DashboardAuth, Layout } from "../layouts";

import {
  StartValidationPage,
  LoginPage,
  OTPPage,
  // HomePage,
} from "../pages";

const Routers = () => {
  return (
    <Routes>
      <Route path='/auth' element={<Layout />}>
        <Route exact path={'auth'} element={<LoginPage />} />
        <Route path={RouteHandler.loginpage} element={<LoginPage />} />
        <Route path={RouteHandler.otppage} element={<OTPPage />} />
      </Route>


      {/* Dashboard */}
      <Route element={<DashboardAuth />}>
        <Route path={RouteHandler.homepage} element={<StartValidationPage />} />
      </Route>
      <Route path="*" element={<Navigate to={RouteHandler.loginpage} />} />
    </Routes>
  );
};

export default Routers;
