import React from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import AuthLayout from "../layouts/AuthLayout"
import HomeLayout from "../layouts/HomeLayout";
import LoginPage from "../pages/authentication/LoginPage";
import RegisterPage from "../pages/authentication/RegisterPage";
import ForgotPasswordPage from "../pages/authentication/ForgotPasswordPage";
import ResetPasswordPage from "../pages/authentication/ResetPasswordPage";

import Dashboard from "../components/Dashboard/Dashboard";
import ProjectList from "../pages/project/ProjectList";
import EmployeeList from "../pages/employee/EmployeeList";
import NotFound from "../pages/Home/NotFound";
import ProtectedRoute from "./ProtectedRoute";
import ProjectDetails from "../pages/project/ProjectDetails";
import Inventory from "../pages/project/Inventory";
import TaskPlannng from "../pages/Activities/TaskPlannng";
import Reports from "../pages/reports/Reports";
import ImageGallary from "../pages/Gallary/ImageGallary";
import Support from "../pages/support/Support";
import Documentation from "../pages/support/Documentation";
import Connect from "../pages/support/Connect";
import ManageProject from "../components/Project/ManageProject";
import ManageEmp from "../pages/employee/ManageEmp";
import EmployeeProfile from "../pages/employee/EmployeeProfile";
import { ErrorPage } from "../pages/support/ErrorPage";
import MasterPage from "../pages/master/MasterPage";
import DailyTask from "../pages/Activities/DailyTask";
import AttendancePage from "../pages/Activities/AttendancePage";


const AppRoutes = () => {
  return (
    <Router>
      <Routes>
        {/* Authentication Routes */}
        <Route element={<AuthLayout />}>
          <Route path="/auth/login" element={<LoginPage />} />
          <Route path="/auth/reqest/demo" element={<RegisterPage />} />
          <Route
            path="/auth/forgot-password"
            element={<ForgotPasswordPage />}
          />
          <Route path="/reset-password" element={<ResetPasswordPage />} />
        </Route>
       

        {/* Protected Routes */}
        <Route element={<ProtectedRoute />}>
          <Route element={<HomeLayout />}>
            <Route path="/" element={<Dashboard />} />
            <Route path="/dashboard" element={<Dashboard />} />
            <Route path="/projects" element={<ProjectList />} />
            <Route path="/projects/:projectId" element={<ProjectDetails />} />
            <Route
              path="/project/manage/:projectId"
              element={<ManageProject />}
            />
            <Route path="/employees" element={<EmployeeList />} />
            <Route path="/employee/:employeeId" element={<EmployeeProfile />} />

            <Route path="/employee/manage" element={<ManageEmp />} />
            <Route
              path="/employee/manage/:employeeId"
              element={<ManageEmp />}
            />
            <Route path="/inventory" element={<Inventory />} />

            <Route path="/activities/attendance" element={<AttendancePage />} />

            <Route path="/activities/records" element={<DailyTask />} />
            <Route path="/activities/task" element={<TaskPlannng />} />

            <Route path="/activities/reports" element={<Reports />} />

            <Route path="/activities/gallary" element={<ImageGallary />} />
            <Route path="/masters" element={<MasterPage />} />

            <Route path="/help/support" element={<Support />} />
            <Route path="/help/docs" element={<Documentation />} />
            <Route path="/help/connect" element={<Connect />} />
          </Route>
        </Route>

        {/* Fallback Route */}
        <Route path="*" element={<ErrorPage />} />
      </Routes>
    </Router>
  );
};

export default AppRoutes;
