import Home from '../pages/Home.jsx'
import Login from '../pages/Login.jsx'
import Register from '../pages/Register.jsx'
import Video from '../pages/Video.jsx'
import ProtectedRoute from '../components/ProtectedRoute.jsx'
import Account from "../pages/Account.jsx";
import ManageChannel from "../pages/ManageChannel.jsx";
import ManageVideo from "../pages/ManageVideo.jsx";
import AddVideo from "../pages/AddVideo.jsx";
import Search from "../pages/Search.jsx";
import Channel from "../pages/Channel.jsx";
import Playlist from "../pages/Playlist.jsx";

const routes = [
    { path: "/", element: <Home/> },
    {
        path: "/login",
        element: (
            <ProtectedRoute requireAuth={false}>
                <Login />
            </ProtectedRoute>
        )
    },
    {
        path: "/register",
        element: (
            <ProtectedRoute requireAuth={false}>
                <Register />
            </ProtectedRoute>
        )
    },
    {
        path: "/video/:id",
        element: (
            <ProtectedRoute requireAuth={false}>
                <Video />
            </ProtectedRoute>
        )
    },
    {
        path: "/profile",
        element: (
            <ProtectedRoute requireAuth={true}>
                <Account/>
            </ProtectedRoute>
        )
    },
    {
        path: "/manage-channel/:id",
        element: (
            <ProtectedRoute requireAuth={true}>
                <ManageChannel/>
            </ProtectedRoute>
        )
    },
    {
        path: "/manage-video/:id",
        element: (
            <ProtectedRoute requireAuth={true}>
                <ManageVideo/>
            </ProtectedRoute>
        )
    },
    {
        path: "/add-video",
        element: (
            <ProtectedRoute requireAuth={true}>
                <AddVideo/>
            </ProtectedRoute>
        )
    },
    {
        path: "search",
        element: (
                <Search />
        )
    },
    {
        path: "channel/:id",
        element: (
                <Channel/>
        )
    },
    {
        path: "playlist/:id",
        element: (
            <ProtectedRoute requireAuth={true}>
                <Playlist/>
            </ProtectedRoute>
        )
    }
]

export default routes;