import { NgModule } from '@angular/core'
import { Routes, RouterModule } from '@angular/router'

import { DashboardComponent } from './dashboard.component'
import { DashboardPageComponent } from './dashboard-page/dashboard-page.component'
import { DashboardPageResolver } from './dashboard-page/dashboard-page-resolver.service'

const routes: Routes = [
    {
        path: '',
        component: DashboardComponent,
        children: [
            {
                path: ':group/:name',
                component: DashboardPageComponent,
                resolve: {
                    dashboard: DashboardPageResolver
                }
            },
        ]
    }
]

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule],
    providers: [DashboardPageResolver]
})
export class DashboardRoutingModule { }
