import {Navigate, Route, Routes} from "react-router-dom";
import {BoardListPage} from "../feature/board/page/BoardListPage.tsx";
import {ADMIN_BBS_MASTER_ROUTE} from "./adminRouteMap.ts";
import {BoardArticleListPage} from "../feature/board/page/BoardArticleListPage.tsx";
import {BoardFormPage} from "../feature/board/page/BoardFormPage.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/cop/bbs/detail/:bbsId`} element={<BoardFormPage/>}/>
            <Route path={`/admin/cop/bbs/detail`} element={<BoardFormPage/>}/>
            <Route path="*" element={<ReadyPage/>}/>
        </Routes>
    );
};
