import {RouteObject} from "react-router-dom";
import ErrorBoundary from "@/routes/error.tsx";

;
import DashboardLayout from "@/routes/layout/dashboard-layout.tsx";
import React from "react";

const UserAuth = React.lazy(() => import("@/pages/user"))
const CreateVideoIndex = React.lazy(() => import("@/pages/video"))
const LibraryIndex = React.lazy(() => import("@/pages/library"))
const LiveIndex = React.lazy(() => import("@/pages/live"))
const NewsIndex = React.lazy(() => import("@/pages/news"))
const NewsEdit = React.lazy(() => import("@/pages/news/edit.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: 'history',
				element: <LibraryIndex/>
			},
			{
				path: 'live',
				element: <LiveIndex/>
			},
		]
	},
]
export default routes