mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
refactor: version 2.0 (React)
This commit is contained in:
parent
7dad7d810a
commit
950f72d4e8
356 changed files with 7901 additions and 29547 deletions
33
packages/renderer/src/components/Router.tsx
Normal file
33
packages/renderer/src/components/Router.tsx
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { Fragment } from 'react'
|
||||
import type { RouteObject } from 'react-router-dom'
|
||||
import { useRoutes } from 'react-router-dom'
|
||||
import Album from '@/pages/Album'
|
||||
import Home from '@/pages/Home'
|
||||
import Login from '@/pages/Login'
|
||||
import Playlist from '@/pages/Playlist'
|
||||
|
||||
const routes: RouteObject[] = [
|
||||
{
|
||||
path: '/',
|
||||
element: <Home />,
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
element: <Login />,
|
||||
},
|
||||
{
|
||||
path: '/playlist/:id',
|
||||
element: <Playlist />,
|
||||
},
|
||||
{
|
||||
path: '/album/:id',
|
||||
element: <Album />,
|
||||
},
|
||||
]
|
||||
|
||||
const router = () => {
|
||||
const element = useRoutes(routes)
|
||||
return <Fragment>{element}</Fragment>
|
||||
}
|
||||
|
||||
export default router
|
||||
Loading…
Add table
Add a link
Reference in a new issue