blob: fd959b9c5ca2d2c63db4b6c06c81d6b487a98194 [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'
8import UploadPage from '../components/UploadPage'
9import PlaceholderPage from '../components/PlaceholderPage'
wueb6e6ca2025-06-15 10:35:32 +080010
11export default function AppRouter() {
12 return (
13 <Routes>
wu90da17b2025-06-19 12:45:29 +080014 {/* 新帖 & 编辑帖(/:postId 可选) */}
15 <Route path="/posts/new" element={<CreatePost />} />
16 <Route path="/posts/edit/:postId" element={<CreatePost />} />
wueb6e6ca2025-06-15 10:35:32 +080017
18 <Route path="/home" element={<HomeFeed />} />
wu90da17b2025-06-19 12:45:29 +080019 <Route path="/notebooks" element={<NotebookPage />} />
20 <Route path="/activity" element={<PlaceholderPage pageId="activity" />} />
21 <Route path="/notes" element={<PlaceholderPage pageId="notes" />} />
22 <Route path="/creator" element={<PlaceholderPage pageId="creator" />} />
23 <Route path="/journal" element={<PlaceholderPage pageId="journal" />} />
wua80b90d2025-06-15 10:36:02 +080024
wu90da17b2025-06-19 12:45:29 +080025 <Route path="/dashboard/*" element={<PlaceholderPage />} />
wueb6e6ca2025-06-15 10:35:32 +080026
wua80b90d2025-06-15 10:36:02 +080027 <Route path="/" element={<Navigate to="/dashboard/overview" replace />} />
wueb6e6ca2025-06-15 10:35:32 +080028 <Route path="*" element={<PlaceholderPage pageId="home" />} />
29 </Routes>
30 )
wua80b90d2025-06-15 10:36:02 +080031}