import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ProfileResolver } from './profile-resolver.service';
import { ProfileComponent } from './profile.component';
import { AuthGuard } from 'src/app/core/services';

const routes: Routes = [
    {
        path: ':username',
        component: ProfileComponent,
        canActivate: [AuthGuard],
        resolve: {
            profile: ProfileResolver
        }
    }
];

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