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

import { FeedsComponent } from '../feeds/feeds.component';

import { TranslateService } from '@ngx-translate/core';
import { NotFoundComponent } from './components';
import { Registration1Component } from './components/registration1/registration1.component';
import { ApiConsumerTokenResolve, LanguageResolve, TestParameterResolve } from './shared';

import { WizardFormComponent } from '../wizardform/wizardform.component';

export const coreRoutes: Routes = [
    {
        path: ':lang',
        resolve: {
            lang: LanguageResolve
        },
        children: [
            /*
            {
                path: 'registration1',
                component: Registration1Component,
                resolve: {
                    token: ApiConsumerTokenResolve,
                    test: TestParameterResolve
                }
            },
            */
            {
                path: 'registration', loadChildren: '../registration/registration.module#RegistrationModule'
            },
            {
                path: 'login', loadChildren: '../login/login.module#LoginModule'
            },
            {
                path: '404',
                component: NotFoundComponent
            },
            {
                path: 'myaccount', loadChildren: '../myaccount/myaccount.module#MyAccountModule'
            },
            {
                path: '',
                component: FeedsComponent
            },
            {
                path: 'feeds',
                component: FeedsComponent,
                resolve: {
                    token: ApiConsumerTokenResolve
                }
            },
            {
                path: 'wizard',
                component: WizardFormComponent
            },
            {
                path: '**',
                component: NotFoundComponent
            }
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(coreRoutes)],
    exports: [RouterModule],
    providers: [LanguageResolve, ApiConsumerTokenResolve]
})
export class CoreRoutingModule { }
