import { Component } from '@angular/core';

import { MENU_ITEMS } from './pages-menu';
import { Router } from '@angular/router';

@Component({
  selector: 'ngx-pages',
  styleUrls: ['pages.component.scss'],
  template: `
    <ngx-one-column-layout>
      <nb-menu [items]="menu"></nb-menu>
      <router-outlet></router-outlet>
    </ngx-one-column-layout>
  `,
})
export class PagesComponent {

 

  menu = MENU_ITEMS;

  constructor(private router: Router){}
  
  ngOnInit() {
    const role = localStorage.getItem('user_role');
    console.log(role);

    if (role === 'FRONT-OFFICE') {
      this.menu = this.menu.filter((item) => item.title !== 'Users');
    }

    console.log(this.menu);
  }
}
