import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import App from './App.vue'
import Home from './pages/Home.vue'
import Privacy from './pages/Privacy.vue'
import Terms from './pages/Terms.vue'
import DocumentationLayout from './pages/documentation/Layout.vue'
import DocumentationIndex from './pages/documentation/Index.vue'
import DocumentationQuickStart from './pages/documentation/QuickStart.vue'
import DocumentationClient from './pages/documentation/Client.vue'
import DocumentationRest from './pages/documentation/Rest.vue'

const router = createRouter({
  scrollBehavior () {
    return { x: 0, y: 0 }
  },
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/privacy',
      name: 'Privacy Policy',
      component: Privacy
    },
    {
      path: '/terms',
      name: 'Terms of Use',
      component: Terms
    },
    {
      path: '/documentation',
      component: DocumentationLayout,
      children: [
        {
          path: '',
          name: 'Documentation',
          component: DocumentationIndex
        },
        {
          path: 'quick-start',
          name: 'DocumentationQuickStart',
          component: DocumentationQuickStart
        },
        {
          path: 'client',
          name: 'DocumentationClient',
          component: DocumentationClient
        },
        {
          path: 'rest',
          name: 'DocumentationRest',
          component: DocumentationRest
        }
      ]
    }
  ]
})

const app = createApp(App)
app.use(router)
app.mount('#app')
