import { lazy } from 'react';
import AdminLayout from './layout';
import { Navigate, Route, Routes } from 'react-router-dom';

const ReportModule = lazy(() => import('./pages/report'));
const SettingModule = lazy(() => import('./pages/setting'));
const LogSettingModule = lazy(() => import('./pages/log-setting'));

export default function AppModule() {
  return (
    <AdminLayout>
      <Routes>
        <Route path="/report" element={<ReportModule />} />
        <Route path="/setting" element={<SettingModule />} />
        <Route path="/log-setting" element={<LogSettingModule />} />
        <Route path="/" element={<Navigate to="/app/report" />} />
        <Route path="*" element={<Navigate to={'/404'} replace={true} />} />
      </Routes>
    </AdminLayout>
  );
}
