import { Route, Routes } from 'react-router-dom';
import { Layout, LoginLayout, MainLayout } from './components/common/Layout';
import LoginBg from './assets/img/login-bg.png';
import { Login } from './pages/Login';
import LoginFail from './pages/LoginFail';
import { AccountEdit, AccountRegist, PasswordReset } from './pages/Account';
import Main from './pages/Main';
import {
	AdminView,
	AuthSetting,
	AuthSettingUpdate,
	CaliumRequest,
	LogView,
} from './pages/UserManage';
import { EconomicIndex, UserIndex } from './pages/IndexManage';
import { LandInfoView, CryptView, GameLogView, UserView } from './pages/DataManage';
import {
	Board,
	Event,
	EventRegist,
	Items,
	Mail,
	MailRegist,
	ReportList,
	UserBlock,
	UserBlockRegist,
	WhiteList,
	LandAuction,
	BattleEvent
} from './pages/ServiceManage';

const RouteInfo = () => {
	return (
		<Routes>
			<Route element={<LoginLayout $bgimg={LoginBg} $padding="50px" />}>
				<Route path="/" element={<Login />} />
				<Route path="/fail" element={<LoginFail />} />
				<Route path="/account/regist" element={<AccountRegist />} />
				<Route path="/account/pwdreset" element={<PasswordReset />} />
				<Route path="/account/edit" element={<AccountEdit />} />
			</Route>
			<Route element={<MainLayout />}>
				<Route path="/main" element={<Main />} />
			</Route>
			<Route element={<Layout />}>
				<Route path="/usermanage/">
					<Route path="adminview" element={<AdminView />} />
					<Route path="logview" element={<LogView />} />
					<Route path="authsetting" element={<AuthSetting />} />
					<Route path="authsetting/:id" element={<AuthSettingUpdate />} />
					<Route path="caliumrequest" element={<CaliumRequest />} />
				</Route>
				<Route path="/indexmanage">
					<Route path="userindex" element={<UserIndex />} />
					<Route path="economicindex" element={<EconomicIndex />} />
				</Route>
				<Route path="/datamanage">
					<Route path="userview" element={<UserView />} />
					<Route path="landview" element={<LandInfoView />} />
					<Route path="gamelogview" element={<GameLogView />} />
					<Route path="cryptview" element={<CryptView />} />
				</Route>
				<Route path="/servicemanage">
					<Route path="board" element={<Board />} />
					<Route path="whitelist" element={<WhiteList />} />
					<Route path="mail" element={<Mail />} />
					<Route path="mail/mailregist" element={<MailRegist />} />
					<Route path="userblock" element={<UserBlock />} />
					<Route path="userblock/userblockregist" element={<UserBlockRegist />} />
					<Route path="reportlist" element={<ReportList />} />
					<Route path="items" element={<Items />} />
					<Route path="event" element={<Event />} />
					<Route path="event/eventregist" element={<EventRegist />} />
					<Route path="landauction" element={<LandAuction />} />
					<Route path="battleevent" element={<BattleEvent />} />
				</Route>
			</Route>
		</Routes>
	)
}

export default RouteInfo;