import {Component, Input, OnInit, OnChanges} from '@angular/core'; import { HelpTopics, LayoutSidebarModel } from '@creedinteractive/onguard-models'; @Component({ selector: 'onguard-sidebar', templateUrl: './sidebar.component.html', styleUrls: ['./sidebar.component.scss'], }) export class SidebarComponent implements OnInit, OnChanges { hideDropdown = true; hideHelp = true; accordionIndex = null; // public help: HelpTopics = new HelpTopics(); public helpSubjects: any[] = []; public model: LayoutSidebarModel = new LayoutSidebarModel(); @Input() help: HelpTopics = new HelpTopics(); @Input() toggleNavTabs: (input: string) => any; constructor() {} private hydrate(data: any): void { this.model.profileName = data.firstName + ' ' + data.lastName; } private receivedUserData(data: any): void { this.hydrate(data); } public unSubscribe(): void { } public logout(): void { } toggleDropdown(): void { this.hideDropdown = !this.hideDropdown; } toggleHelp(): void { this.hideHelp = !this.hideHelp; } toggleAccordion(index): void { if (this.accordionIndex === index) { this.accordionIndex = null; } else { this.accordionIndex = index; } } ngOnInit(): void {} ngOnChanges(): void { this.accordionIndex = null; } }