import {Component, OnInit} from '@angular/core';
import {AlertService, AuthenticationService, UserService} from '../../_services';
import {ActivatedRoute, Router} from '@angular/router';
import {AppComponent} from '../../app.component';
import {User} from '../../_models';

@Component({
  selector: 'app-header',
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.scss']
})

export class HeaderComponent implements OnInit {

  public currentUser: User;
  public page_with_two_sidebar;
  public page_with_mega_menu;

  constructor(private authenticationService: AuthenticationService, private router: Router) {
    if (localStorage.getItem('currentUser') !== null) {
      this.currentUser = JSON.parse(localStorage.getItem('currentUser')).profile;
    } else {
      this.currentUser = new User();
    }
  }

  ngOnInit() {

  }

  logout(){
    // this.authenticationService.logout()
    this.router.navigate(['/login']);
  }

}




