import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

//import { AuthenticationService } from '@app/services/authentication.service';
import { User, Role } from './models';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
  title = 'plant-viewer';
  currentUser: User;

  constructor(
    private router: Router,
    //private authenticationService: AuthenticationService,
  )

  {
    //this.authenticationService.currentUser.subscribe(x => this.currentUser = x);
  }

  ngOnInit() {
  }

  get isAdmin() {
    return this.currentUser && this.currentUser.role === Role.Admin;
  }

}
