11import { AfterContentInit , ChangeDetectionStrategy , Component , ContentChildren , QueryList } from '@angular/core' ;
22import { ActivatedRoute } from '@angular/router' ;
3- import { FeatureState , NavigationParams , NavigationParamsType , NavigationService } from '@hypertrace/common' ;
3+ import { Color , FeatureState , NavigationParams , NavigationParamsType , NavigationService } from '@hypertrace/common' ;
44import { merge , Observable } from 'rxjs' ;
55import { map , startWith } from 'rxjs/operators' ;
66import { NavigableTabComponent } from './navigable-tab.component' ;
@@ -22,6 +22,14 @@ import { NavigableTabComponent } from './navigable-tab.component';
2222 class="tab-link"
2323 >
2424 <ng-container *ngTemplateOutlet="tab.content"></ng-container>
25+ <ng-container *ngIf="tab.labelTag">
26+ <ht-label-tag
27+ class="tab-label-tag"
28+ [label]="tab.labelTag"
29+ [backgroundColor]="this.getBackgroundColor(activeTab, tab)"
30+ [labelColor]="this.getLabelColor(activeTab, tab)"
31+ ></ht-label-tag>
32+ </ng-container>
2533 <span *ngIf="featureState === '${ FeatureState . Preview } '" class="soon-container">
2634 <span class="soon">SOON</span>
2735 </span>
@@ -60,6 +68,14 @@ export class NavigableTabGroupComponent implements AfterContentInit {
6068 replaceCurrentHistory : tab . replaceHistory
6169 } ) ;
6270
71+ public getBackgroundColor ( activeTab : NavigableTabComponent | undefined , tab : NavigableTabComponent ) : Color {
72+ return activeTab === tab ? Color . Gray9 : Color . Gray2 ;
73+ }
74+
75+ public getLabelColor ( activeTab : NavigableTabComponent | undefined , tab : NavigableTabComponent ) : Color {
76+ return activeTab === tab ? Color . White : Color . Gray5 ;
77+ }
78+
6379 private findActiveTab ( ) : NavigableTabComponent | undefined {
6480 return this . tabs . find ( tab => this . navigationService . isRelativePathActive ( [ tab . path ] , this . activatedRoute ) ) ;
6581 }
0 commit comments