mempool/frontend/src/app/components/rbf-timeline/rbf-timeline.component.ts

38 lines
1.1 KiB
TypeScript
Raw Normal View History

import { Component, Input, OnInit, OnChanges, Inject, LOCALE_ID } from '@angular/core';
import { Router } from '@angular/router';
import { RbfInfo } from '../../interfaces/node-api.interface';
import { StateService } from '../../services/state.service';
import { ApiService } from '../../services/api.service';
@Component({
selector: 'app-rbf-timeline',
templateUrl: './rbf-timeline.component.html',
styleUrls: ['./rbf-timeline.component.scss'],
})
export class RbfTimelineComponent implements OnInit, OnChanges {
@Input() replacements: RbfInfo[];
@Input() txid: string;
2022-12-14 16:51:53 -06:00
mined: boolean;
dir: 'rtl' | 'ltr' = 'ltr';
constructor(
private router: Router,
private stateService: StateService,
private apiService: ApiService,
@Inject(LOCALE_ID) private locale: string,
) {
if (this.locale.startsWith('ar') || this.locale.startsWith('fa') || this.locale.startsWith('he')) {
this.dir = 'rtl';
}
}
ngOnInit(): void {
2022-12-14 16:51:53 -06:00
this.mined = this.replacements.some(entry => entry.mined);
}
ngOnChanges(): void {
2022-12-14 16:51:53 -06:00
this.mined = this.replacements.some(entry => entry.mined);
}
}