import { Component, EventEmitter, HostListener,Inject,Injector,Input, Optional, Output } from '@angular/core'; import { Router } from '@angular/router'; import { AngularLibComponent } from '../angular-lib.component'; import { CommonModule } from '@angular/common'; import OktaAuth from '@okta/okta-auth-js'; import { OKTA_AUTH } from '@okta/okta-angular'; @Component({ selector: 'lib-header', standalone: true, imports: [AngularLibComponent,HeaderComponent,CommonModule], templateUrl: './header.component.html', styleUrl: './header.component.css' }) export class HeaderComponent { @Input() appName: string = 'Application Name'; @Input() public fedexlogo = '../../assets/images/fedexlogo.svg'; @Input() public profileImageUrl = '../../assets/images/profile_icon_white.svg'; @Output() onSignOutBtnClick = new EventEmitter(); isSideBarOpen: boolean = false; // isHelpOpen: boolean = false; showProfileMenu:boolean = false; pageTitle: string = 'Home'; @HostListener('document:click') closeDropdownDownMenu() { this.showProfileMenu = false; } constructor( @Inject(OKTA_AUTH) private oktaAuth: OktaAuth, ) {} ngOnInit() { // this.router.events.pipe(filter(event => event instanceof NavigationEnd)).subscribe(event => { // if(this.route.snapshot.firstChild) { // this.pageTitle = this.route.snapshot.firstChild.data['title']; // } // }); } // openHelp() { // this.isHelpOpen = !this.isHelpOpen; // } // closeHelp() { // this.isHelpOpen = !this.isHelpOpen; // } openProfileMenu(event:any) { event.stopPropagation(); this.showProfileMenu = !this.showProfileMenu; } // signOut() { // this.onSignOutBtnClick.emit(); // } signOut() { this.oktaAuth.signOut(); } }