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

import AdminLayout from '../layouts/AdminLayout.vue'

const ReportPage = () => import('../pages/ReportPage.vue')
const UsersPage = () => import('../pages/UsersPage.vue')
const FeedbacksPage = () => import('../pages/FeedbacksPage.vue')
const LogsPage = () => import('../pages/LogsPage.vue')
const AnnouncementsPage = () => import('../pages/AnnouncementsPage.vue')
const EmailPage = () => import('../pages/EmailPage.vue')
const SecurityPage = () => import('../pages/SecurityPage.vue')
const SystemPage = () => import('../pages/SystemPage.vue')
const SettingsPage = () => import('../pages/SettingsPage.vue')

const routes = [
  {
    path: '/',
    component: AdminLayout,
    children: [
      { path: '', redirect: '/reports' },
      { path: '/pending', redirect: '/reports' },
      { path: '/stats', redirect: '/reports' },
      { path: '/reports', name: 'reports', component: ReportPage },
      { path: '/users', name: 'users', component: UsersPage },
      { path: '/feedbacks', name: 'feedbacks', component: FeedbacksPage },
      { path: '/logs', name: 'logs', component: LogsPage },
      { path: '/announcements', name: 'announcements', component: AnnouncementsPage },
      { path: '/email', name: 'email', component: EmailPage },
      { path: '/security', name: 'security', component: SecurityPage },
      { path: '/system', name: 'system', component: SystemPage },
      { path: '/settings', name: 'settings', component: SettingsPage },
    ],
  },
]

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

export default router
