26 lines
702 B
TypeScript
26 lines
702 B
TypeScript
import {Component, Input, OnInit} from '@angular/core';
|
|
import {Header, Item} from "../../../utils/entities/sidebar";
|
|
|
|
@Component({
|
|
selector: 'dashboard-sidebar',
|
|
templateUrl: 'sideBar.component.html'
|
|
})
|
|
export class SideBarComponent implements OnInit {
|
|
@Input() items: Item[] = [];
|
|
@Input() header: Header = null;
|
|
@Input() showHeader: boolean = true;
|
|
@Input() activeItem: string = '';
|
|
@Input() activeSubItem: string = '';
|
|
|
|
constructor() {}
|
|
|
|
ngOnInit(): void {
|
|
}
|
|
|
|
|
|
isTheActiveMenuItem(item: Item, subItem: Item = null): boolean {
|
|
return (!subItem && this.activeItem === item.id) ||
|
|
(subItem && this.activeItem === item.id && this.activeSubItem === subItem.id);
|
|
}
|
|
}
|