import type { RouteRecordRaw } from 'vue-router'

const appChildren: RouteRecordRaw[] = [
  {
    path: '',
    redirect: '/chat',
  },
  {
    path: 'chat',
    name: 'chat',
    component: () => import('@/pages/chat/index.vue'),
  },
  {
    path: 'knowledge',
    name: 'knowledge',
    component: () => import('@/pages/knowledge/index.vue'),
  },
  {
    path: 'brain',
    name: 'brain',
    component: () => import('@/pages/brain/index.vue'),
  },
  {
    path: 'graph',
    name: 'graph',
    component: () => import('@/pages/graph/index.vue'),
  },
  {
    path: 'kanban',
    name: 'kanban',
    component: () => import('@/pages/kanban/index.vue'),
  },
  {
    path: 'forum',
    name: 'forum',
    component: () => import('@/pages/forum/index.vue'),
  },
  {
    path: 'agents',
    name: 'agents',
    component: () => import('@/pages/agents/index.vue'),
  },
  {
    path: 'stats',
    name: 'stats',
    component: () => import('@/pages/stats/index.vue'),
  },
  {
    path: 'skills',
    name: 'skills',
    component: () => import('@/pages/skills/index.vue'),
  },
  {
    path: 'todo',
    name: 'todo',
    component: () => import('@/pages/todo/index.vue'),
  },
  {
    path: 'settings',
    name: 'settings',
    component: () => import('@/pages/settings/index.vue'),
  },
  {
    path: 'logs',
    name: 'logs',
    component: () => import('@/pages/logs/index.vue'),
  },
]

export const routes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/pages/login/index.vue'),
    meta: { guest: true },
  },
  {
    path: '/',
    component: () => import('@/pages/app/layout.vue'),
    meta: { requiresAuth: true },
    children: appChildren,
  },
]

export { appChildren }
