53 lines
1.2 KiB
TypeScript
53 lines
1.2 KiB
TypeScript
import {RouteObject} from "react-router-dom";
|
|
import React from "react";
|
|
|
|
import ErrorBoundary from "@/routes/error.tsx";
|
|
import DashboardLayout from "@/routes/layout/dashboard-layout.tsx";
|
|
|
|
const UserAuth = React.lazy(() => import("@/pages/user"))
|
|
const CreateVideoIndex = React.lazy(() => import("@/pages/video"))
|
|
const RecycleIndex = React.lazy(() => import("../pages/recycle"))
|
|
const LiveIndex = React.lazy(() => import("@/pages/live"))
|
|
const NewsIndex = React.lazy(() => import("@/pages/news"))
|
|
const NewsEdit = React.lazy(() => import("@/pages/news/edit.tsx"))
|
|
const OrderIndex = React.lazy(() => import("@/pages/order/index.tsx"))
|
|
|
|
const routes: RouteObject[] = [
|
|
|
|
{
|
|
path: '/',
|
|
element: <DashboardLayout/>,
|
|
errorElement: <ErrorBoundary/>,
|
|
children: [
|
|
{
|
|
path: '',
|
|
element: <NewsIndex/>
|
|
},
|
|
{
|
|
path: 'user',
|
|
element: <UserAuth/>,
|
|
},
|
|
{
|
|
path: 'edit',
|
|
element: <NewsEdit/>
|
|
},
|
|
{
|
|
path: 'create',
|
|
element: <CreateVideoIndex/>
|
|
},
|
|
{
|
|
path: 'recycle',
|
|
element: <RecycleIndex/>
|
|
},
|
|
{
|
|
path: 'order',
|
|
element: <OrderIndex/>
|
|
},
|
|
{
|
|
path: 'live',
|
|
element: <LiveIndex/>
|
|
},
|
|
]
|
|
},
|
|
]
|
|
export default routes |