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

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'MainFrame',
        component: () => import('@/views/main-frame/MainFrame.vue'),
        children: [
            {
                path: '',
                name: 'Workbench',
                component: () => import('@/views/workbench/Workbench.vue'),
            },
            {
                path: 'project-list',
                name: 'ProjectList',
                component: () => import('@/views/project-list/ProjectList.vue'),
            },
            {
                path: 'data-library',
                name: 'DataLibrary',
                component: () => import('@/views/data-library/DataLibrary.vue'),
            },
            {
                path: 'project',
                name: 'Project',
                component: () => import('@/views/project/Project.vue'),
                children: [
                    {
                        path: '',
                        name: 'Overview',
                        component: () => import('@/views/project/overview/Overview.vue')
                    },
                    {
                        path: 'process',
                        name: 'Process',
                        component: () => import('@/views/project/process/Process.vue')
                    },
                    {
                        path: 'summary',
                        name: 'Summary',
                        component: () => import('@/views/project/summary/Summary.vue')
                    },
                    {
                        path: 'report',
                        name: 'Report',
                        component: () => import('@/views/project/report/Report.vue')
                    }
                ]
            }
        ]
    },
    {
        path: '/login',
        name: 'Login',
        component: () => import('@/views/login/Login.vue'),
    },
    {
        path: '/examples',
        name: 'Examples',
        component: () => import('@/examples/Examples.vue')
    }
];

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

export default router;
