You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
911 B
TypeScript
28 lines
911 B
TypeScript
import { Component, OnChanges, Input } from '@angular/core';
|
|
import { GetInfo } from '../../../shared/models/clnModels';
|
|
import { CommonService } from '../../../shared/services/common.service';
|
|
|
|
@Component({
|
|
selector: 'rtl-cln-node-info',
|
|
templateUrl: './node-info.component.html',
|
|
styleUrls: ['./node-info.component.scss']
|
|
})
|
|
export class CLNNodeInfoComponent implements OnChanges {
|
|
|
|
@Input() information: GetInfo;
|
|
@Input() showColorFieldSeparately: boolean;
|
|
public chains: Array<string> = [''];
|
|
|
|
constructor(private commonService: CommonService) { }
|
|
|
|
ngOnChanges() {
|
|
if (this.information && this.information.chains && this.information.chains.length > 0) {
|
|
this.chains = [''];
|
|
this.information.chains.forEach((chain) => {
|
|
this.chains.push(this.commonService.titleCase(chain.chain || '') + ' ' + this.commonService.titleCase(chain.network || ''));
|
|
});
|
|
}
|
|
}
|
|
|
|
}
|