import { Routes, Route, Navigate } from 'react-router-dom';
import { AdminLayout } from '../layouts';
import {
  Dashboard,
  JobCreationPage,
  JobListPage,
  NotFound,
  Profile,
  ScrapingDataListPage,
} from '../scenes';
import { ROUTES } from '../constants/paths';

const UserRoutes = () => {
  // Thêm các tuyến đường cụ thể cho người dùng ở đây
  return (
    <Routes>
      <Route element={<AdminLayout />}>
        <Route path={ROUTES.DASHBOARD.ROOT.path} index element={<Dashboard />} />
        <Route path={ROUTES.DASHBOARD.JOBS.CREATE.path} element={<JobCreationPage />} />
        <Route path={ROUTES.DASHBOARD.JOBS.ROOT.path} element={<JobListPage />} />
        <Route path={ROUTES.DASHBOARD.PROFILE.ROOT.path} element={<Profile />} />
        <Route path={ROUTES.DASHBOARD.RECORDS.VIEW_SCRATCH_DATA.path} element={<ScrapingDataListPage />} />
        <Route path={ROUTES.DASHBOARD.NOT_FOUND.path} element={<NotFound />} />
        <Route path="*" element={<Navigate to={ROUTES.DASHBOARD.NOT_FOUND.path} />} />
      </Route>
    </Routes>
  );
};

export default UserRoutes;
