import { createRouter, createWebHistory } from 'vue-router'
import AppStack from '../Pages/AppStack/AppStack.vue'

import SignIn from '@/Pages/AuthStack/SignIn/SignIn.vue'
import SignUp from '@/Pages/AuthStack/SignUp/SignUp.vue'
import Error404 from '@/Pages/ErrorPage/Error404/Error404.vue'

import Employees from '@/Pages/AppStack/Employee/Employees/Employees.vue'
import AddEmployee from '../Pages/AppStack/Employee/AddEmp/AddEmp.vue'
import EditEmployee from '../Pages/AppStack/Employee/EditEmp/EditEmpl.vue'


import Averias from '@/Pages/AppStack/Averia/Averias/Averias.vue'
import AddAveria from '../Pages/AppStack/Averia/AddAveria/AddAveria.vue'
import EditAveria from '../Pages/AppStack/Averia/EditAveria/EditAveria.vue'



const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'main',
            component: SignIn
        },
        {
            path: '/login',
            name: 'login',
            component: SignIn
        },
        {
            path: '/register',
            name: 'register',
            component: SignUp
        },
        {
            path: '/app',
            name: 'app',
            component: AppStack,
            children: [
                {
                    path: '',
                    component: Employees
                },
                {
                    path: 'employees',
                    component: Employees
                },
                {
                    path: 'addEmployee',
                    component:AddEmployee

                },
                {
                    path: 'editEmployee/:id',
                    component:EditEmployee

                },
                {
                    path: 'averias',
                    component: Averias
                },
                {
                    path: 'addAveria',
                    component:AddAveria

                },
                {
                    path: 'editAveria/:id',
                    component:EditAveria

                },
                {
                    path: 'dashboard',
                    component: ''
                }
            ]
        },
        {
            path: '/:pathMatch(.*)*',
            name: '404',
            component: Error404
        },
    ]
})

export default router