You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
import { createBrowserRouter } from "react-router-dom";
|
|
import AuthRequired from "@/components/Auth/AuthRequired";
|
|
import UnauthorizeRequired from "@/components/Auth/UnauthorizeRequired";
|
|
|
|
import AdminLayout from "@/components/Layouts/AdminLayout";
|
|
|
|
import DashboardPage from "@/pages/Admin/DashboardPage.tsx";
|
|
import LoginPage from "@/pages/Admin/LoginPage";
|
|
import ArtistsPage from "@/pages/Admin/ArtistsPage";
|
|
import UsersPage from "@/pages/Admin/UsersPage";
|
|
import VideosPage from "@/pages/Admin/VideosPage";
|
|
import PlatlistsPage from "@/pages/Admin/PlatlistsPage";
|
|
|
|
import App from "@/App";
|
|
|
|
const router = createBrowserRouter([
|
|
{
|
|
element: <AuthRequired><AdminLayout/></AuthRequired>,
|
|
children: [
|
|
{
|
|
path: "/admin",
|
|
element: <DashboardPage/>
|
|
},
|
|
{
|
|
path: "/admin/artists",
|
|
element: <ArtistsPage/>
|
|
},
|
|
{
|
|
path: "/admin/playlists",
|
|
element: <PlatlistsPage/>
|
|
},
|
|
{
|
|
path: "/admin/videos",
|
|
element: <VideosPage/>
|
|
},
|
|
{
|
|
path: "/admin/users",
|
|
element: <UsersPage/>
|
|
},
|
|
]
|
|
},
|
|
{
|
|
path: "/login",
|
|
element: <UnauthorizeRequired><LoginPage /></UnauthorizeRequired>,
|
|
},
|
|
{
|
|
path: "/",
|
|
element: <App/>,
|
|
},
|
|
]);
|
|
|
|
export default router; |