blob: 225a7143a5e503d055396f7c95c12d246db67f6c [file] [log] [blame]
wua80b90d2025-06-15 10:36:02 +08001// src/router/index.jsx
wu90da17b2025-06-19 12:45:29 +08002
wueb6e6ca2025-06-15 10:35:32 +08003import React from 'react'
4import { Routes, Route, Navigate } from 'react-router-dom'
wu90da17b2025-06-19 12:45:29 +08005import CreatePost from '../components/CreatePost'
6import HomeFeed from '../components/HomeFeed'
7import NotebookPage from '../components/NotebookPage'
wu90da17b2025-06-19 12:45:29 +08008import PlaceholderPage from '../components/PlaceholderPage'
wueb6e6ca2025-06-15 10:35:32 +08009
10export default function AppRouter() {
11 return (
12 <Routes>
wu90da17b2025-06-19 12:45:29 +080013 {/* 新帖 & 编辑帖(/:postId 可选) */}
14 <Route path="/posts/new" element={<CreatePost />} />
15 <Route path="/posts/edit/:postId" element={<CreatePost />} />
wueb6e6ca2025-06-15 10:35:32 +080016
17 <Route path="/home" element={<HomeFeed />} />
wu90da17b2025-06-19 12:45:29 +080018 <Route path="/notebooks" element={<NotebookPage />} />
19 <Route path="/activity" element={<PlaceholderPage pageId="activity" />} />
20 <Route path="/notes" element={<PlaceholderPage pageId="notes" />} />
21 <Route path="/creator" element={<PlaceholderPage pageId="creator" />} />
22 <Route path="/journal" element={<PlaceholderPage pageId="journal" />} />
wua80b90d2025-06-15 10:36:02 +080023
wu90da17b2025-06-19 12:45:29 +080024 <Route path="/dashboard/*" element={<PlaceholderPage />} />
wueb6e6ca2025-06-15 10:35:32 +080025
wua80b90d2025-06-15 10:36:02 +080026 <Route path="/" element={<Navigate to="/dashboard/overview" replace />} />
wueb6e6ca2025-06-15 10:35:32 +080027 <Route path="*" element={<PlaceholderPage pageId="home" />} />
28 </Routes>
29 )
wua80b90d2025-06-15 10:36:02 +080030}