diff options
Diffstat (limited to 'src/routes.ts')
| -rw-r--r-- | src/routes.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/routes.ts b/src/routes.ts new file mode 100644 index 0000000..83f97b6 --- /dev/null +++ b/src/routes.ts @@ -0,0 +1,39 @@ +import { HouseIcon, InfoIcon, UserIcon } from '@phosphor-icons/react' +import type { Icon } from '@phosphor-icons/react' +import type { RouteObject } from 'react-router' +import App from './App.tsx' +import About from './About.tsx' +import Me from './Me.tsx' + +export type PageRoute = RouteObject & { + handle?: { title: string; icon: Icon } + children?: PageRoute[] +} + +export const pageRoutes = [ + { + id: 'home', + index: true, + Component: App, + handle: { title: '首页', icon: HouseIcon }, + }, + { + id: 'about', + path: '/about', + handle: { title: '关于', icon: InfoIcon }, + children: [ + { + id: 'about-index', + index: true, + Component: About, + handle: { title: '关于概览', icon: InfoIcon }, + }, + { + id: 'about-me', + path: 'me', + Component: Me, + handle: { title: '关于我', icon: UserIcon }, + }, + ], + }, +] satisfies PageRoute[] |
