index.js 1.02 KB
import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/company'
  },
  {
    path: '/agents/:agentId?',
    redirect: to => `/agent/${to.params.agentId || 'agent-creator'}`,
  },
  {
    path: '/agent/:agentId/:convId?',
    name: 'AgentChat',
    component: () => import('@/views/AgentChat.vue'),
    props: true,
  },
  {
    path: '/:id/agents/:agentId?/:convId?',
    name: 'CompanyAgentChat',
    component: () => import('@/views/AgentChat.vue'),
    props: true,
  },
  {
    path: '/company',
    name: 'CompanyList',
    component: () => import('@/views/CompanyDashboard.vue'),
  },
  {
    path: '/:id/:tab(overview|agents|pipelines|goals|sop|okr|team)',
    name: 'CompanyDetail',
    component: () => import('@/views/CompanyDashboard.vue'),
    props: true
  },
  {
    path: '/okr',
    name: 'OkrDashboard',
    component: () => import('@/views/OkrDashboard.vue'),
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router