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

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'start',
      component: () => import('../views/Startpage.vue'),
      meta: { breadcrumb: [] },
    },
    {
      path: '/tasks',
      name: 'tasks',
      component: () => import('../views/Task.vue'),
      meta: { breadcrumb: [{ label: 'Tasks', to: '/tasks' }] },
    },
    {
      path: '/tasks/all',
      name: 'tasks-all',
      component: () => import('../views/TaskAll.vue'),
      meta: {
        breadcrumb: [
          { label: 'Tasks', to: '/tasks' },
          { label: 'All' },
        ],
      },
    },
    {
      path: '/schemas',
      name: 'schemas',
      component: () => import('../views/SchemaAll.vue'),
      meta: {
        breadcrumb: [
          { label: 'Tasks', to: '/tasks' },
          { label: 'Schemas' },
        ],
      },
    },
    {
      path: '/schemas/create',
      name: 'schemas-create',
      component: () => import('../views/SchemaCreate.vue'),
      meta: {
        breadcrumb: [
          { label: 'Tasks', to: '/tasks' },
          { label: 'Schemas', to: '/schemas' },
          { label: 'Create' },
        ],
      },
    },
    {
      path: '/schemas/:id(\\d+)',
      name: 'schemas-edit',
      component: () => import('../views/SchemaEdit.vue'),
      meta: {
        breadcrumb: [
          { label: 'Tasks', to: '/tasks' },
          { label: 'Schemas', to: '/schemas' },
          { label: 'Edit' },
        ],
      },
    },
    {
      path: '/tasks/:id(\\d+)',
      name: 'tasks-edit',
      component: () => import('../views/TaskEdit.vue'),
      meta: {
        breadcrumb: [
          { label: 'Tasks', to: '/tasks' },
          { label: 'Edit' },
        ],
      },
    },
  ],
})

export default router
