import {Navigate, Route, Routes} from "react-router-dom";
import {BoardListPage} from "../feature/board/master/page/BoardListPage.tsx";
import {
    ADMIN_AUTHOR_DETAIL_ROUTE,
    ADMIN_AUTHOR_LIST_ROUTE,
    ADMIN_AUTHOR_ROLE_LIST_ROUTE, ADMIN_BBS_ARTICLE_FORM_ROUTE,
    ADMIN_BBS_MASTER_ROUTE, ADMIN_ROLE_FORM_ROUTE
} from "./adminRouteMap.ts";
import {BoardArticleListPage} from "../feature/board/article/page/BoardArticleListPage.tsx";
import {BoardFormPage} from "../feature/board/master/page/BoardFormPage.tsx";
import {AuthorListPage} from "../feature/role/author/page/AuthorListPage.tsx";
import {AuthorRoleListPage} from "../feature/role/authorRole/page/AuthorRoleListPage.tsx";
import {AuthorRoleFormPage} from "../feature/role/role/page/AuthorRoleFormPage.tsx";

const ReadyPage = () => {
    return <div>Preparing menu.</div>;
};

export const AdminRoute = () => {
    return (
        <Routes>
            <Route path="/" element={<Navigate to={ADMIN_BBS_MASTER_ROUTE} replace/>}/>
            <Route path={ADMIN_BBS_MASTER_ROUTE} element={<BoardListPage/>}/>
            <Route path={`/admin/cop/bbs/article/:bbsId`} element={<BoardArticleListPage/>}/>
            <Route path={`${ADMIN_BBS_ARTICLE_FORM_ROUTE}:bbsId`} element={<BoardFormPage/>}/>
            <Route path={ADMIN_BBS_ARTICLE_FORM_ROUTE} element={<BoardFormPage/>}/>

            <Route path={ADMIN_AUTHOR_LIST_ROUTE} element={<AuthorListPage/>}/>
            <Route path={ADMIN_AUTHOR_DETAIL_ROUTE} element={<ReadyPage/>}/>
            <Route path={ADMIN_AUTHOR_ROLE_LIST_ROUTE} element={<AuthorRoleListPage/>}/>
            <Route path={ADMIN_ROLE_FORM_ROUTE} element={<AuthorRoleFormPage/>}/>
            <Route path="*" element={<ReadyPage/>}/>
        </Routes>
    );
};
