import { createRouter, createWebHashHistory } from 'vue-router'
import ChatroomPage from '@/pages/ChatroomPage.vue'
import WelcomePage from '@/pages/WelcomePage.vue'
import Chatroom1Page from '@/pages/Chatroom1Page.vue'
import AdminPage from '@/pages/AdminPage.vue'
import AdminOverview from '@/pages/admin/AdminOverview.vue'
import AdminUserInfo from '@/pages/admin/AdminUserInfo.vue'
import AdminUserSecurity from '@/pages/admin/AdminUserSecurity.vue'
import AdminUserUpload from '@/pages/admin/AdminUserUpload.vue'
import AdminNyahome from '@/pages/admin/AdminNyahome.vue'
import AdminUserScript from '@/pages/admin/AdminUserScript.vue'
import Marketplace from '@/pages/Marketplace.vue'

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      name: 'welcome',
      path: '/',
      component: WelcomePage,
    },
    {
      name: 'chatroom-1',
      path: '/chatroom/:id',
      component: Chatroom1Page,
    },
    {
      name: 'chatroom',
      path: '/chatroom',
      component: ChatroomPage,
    },
    {
      name: 'marketplace',
      path: '/marketplace',
      component: Marketplace,
    },
    {
      name: 'admin',
      path: '/admin/',
      component: AdminPage,
      children: [
        {
          name: 'admin-overview',
          path: '',
          component: AdminOverview,
        },
        {
          name: 'admin-user-info',
          path: 'user-info',
          component: AdminUserInfo,
        },
        {
          name: 'admin-user-security',
          path: 'user-security',
          component: AdminUserSecurity,
        },
        {
          name: 'admin-user-upload',
          path: 'user-upload',
          component: AdminUserUpload,
        },
        {
          name: 'admin-user-script',
          path: 'user-script',
          component: AdminUserScript,
        },
        {
          name: 'admin-nyahome',
          path: 'nyahome',
          component: AdminNyahome,
        },
      ],
    },
  ],
})

export default router
