/**
 * 路由配置
 */

import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'home',
      redirect: '/devices',
    },
    {
      path: '/devices',
      name: 'devices',
      component: () => import('@/pages/DeviceList.vue'),
      meta: { title: '设备列表' },
    },
    {
      path: '/chat/:deviceId',
      name: 'chat',
      component: () => import('@/pages/ChatWindow.vue'),
      meta: { title: '聊天' },
    },
    {
      path: '/files',
      name: 'files',
      component: () => import('@/pages/FileTransfer.vue'),
      meta: { title: '文件传输' },
    },
    {
      path: '/settings',
      name: 'settings',
      component: () => import('@/pages/Settings.vue'),
      meta: { title: '设置' },
    },
  ],
})

export default router
