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

import { InfoComponent } from '../info/info.component'
import { MeasuresComponent } from './measures.component'
import { MeasuresHomeComponent } from './measures-list/measures-home.component'
import { MeasuresListComponent } from './measures-list/measures-list.component'

const routes: Routes = [
    {
        path: '',
        component: MeasuresComponent,
        children: [
            {
                path: ':store',
                component: MeasuresListComponent,
                children: [
                    {
                        path: ':id',
                        component: InfoComponent,
                    }
                ]
            },
            {
                path: '',
                pathMatch: 'full',
                component: MeasuresHomeComponent,
            }
        ]
    }
]

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