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;