import {ChangeDetectionStrategy, Component, Input, OnInit} from '@angular/core'; import {Router} from '@angular/router'; @Component({ selector: 'app-transaction-details', templateUrl: './transaction-details.component.html', styleUrls: ['./transaction-details.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) export class TransactionDetailsComponent implements OnInit { @Input() transaction; senderBloxbergLink: string; recipientBloxbergLink: string; constructor(private router: Router) { } ngOnInit(): void { this.senderBloxbergLink = 'https://blockexplorer.bloxberg.org/address/' + this.transaction?.from + '/transactions'; this.recipientBloxbergLink = 'https://blockexplorer.bloxberg.org/address/' + this.transaction?.to + '/transactions'; } async viewSender(): Promise { await this.router.navigateByUrl(`/accounts/${this.transaction.from}`); } async viewRecipient(): Promise { await this.router.navigateByUrl(`/accounts/${this.transaction.to}`); } }