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

import Layout from '@/views/Layout/index.vue'
import Home from '@/views/Home/index.vue'


const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'layout',
    component: Layout,
    // redirect: '/home',
    children: [
      {
        // path: 'home',
        path: '',
        name: 'home',
        component: Home
      },
      {
        path: 'faq',
        name: 'FAQ',
        component: () => import("@/views/FAQ/index.vue")
      },
      {
        path: 'article/article_details',
        name: 'article_details',
        component: () => import("@/views/ArticleDetails/index.vue")
      },
    ]
  },
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes,
})

export default router
