All files / application-header si-account-details.component.ts

20% Statements 1/5
100% Branches 0/0
100% Functions 0/0
20% Lines 1/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42                                                              1x                    
/**
 * Copyright (c) Siemens 2016 - 2025
 * SPDX-License-Identifier: MIT
 */
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import { TranslatePipe } from '@ngx-translate/core';
import { TranslatableString } from '@siemens/element-translate-ng/translate';
 
@Component({
  selector: 'si-account-details',
  imports: [TranslatePipe],
  template: `
    <div class="mx-5">
      <div class="si-h5">{{ name() }}</div>
      @if (email()) {
        <div>{{ email() }}</div>
      }
      @if (company() || userRole()) {
        <div class="d-flex align-items-center text-secondary mt-2">
          @if (company()) {
            {{ company() }}
          }
          @if (userRole()) {
            <span class="badge bg-default">{{ userRole()! | translate }}</span>
          }
        </div>
      }
    </div>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class SiAccountDetailsComponent {
  /** The user's full name. */
  readonly name = input.required<string>();
  /** The user's company name. */
  readonly company = input<string>();
  /** The user's email address. */
  readonly email = input<string>();
  /** The user's role. */
  readonly userRole = input<TranslatableString>();
}