import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import { ConfigProvider } from 'antd';
import { App as ContainerApp } from './pages/container';
import { App as MapApp } from './pages/map';
import { App as UserApp } from './pages/user';
import { App as UserAppApp } from './pages/app';
import { App as FileApp } from './pages/file';
import { App as OrgApp } from './pages/org';
import { basename } from './modules/basename';
import { Redirect } from './modules/Redirect';

export const App = () => {
  return (
    <div className='w-full h-full'>
      <ConfigProvider
        theme={{
          token: {},
        }}>
        <Router basename={basename}>
          <Routes>
            <Route path='/' element={<Redirect to='/container/' />} />
            <Route path='/container/*' element={<ContainerApp />} />
            <Route path='/map/*' element={<MapApp />} />
            <Route path='/user/*' element={<UserApp />} />
            <Route path='/org/*' element={<OrgApp />} />
            <Route path='/app/*' element={<UserAppApp />} />
            <Route path='/file/*' element={<FileApp />} />

            <Route path='/404' element={<div>404</div>} />
            <Route path='*' element={<div>404</div>} />
          </Routes>
        </Router>
      </ConfigProvider>
      <div id='for-modal'></div>
    </div>
  );
};
