Chocobozzz/PeerTube

View on GitHub
client/src/app/shared/shared-main/buttons/button.component.html

Summary

Maintainability
Test Coverage
<button *ngIf="!ptRouterLink" type="button" class="action-button" [ngClass]="classes" [disabled]="disabled" [ngbTooltip]="title">
  <ng-container *ngTemplateOutlet="content"></ng-container>
</button>

<a *ngIf="ptRouterLink" class="action-button" [ngClass]="classes" [ngbTooltip]="title" [routerLink]="ptRouterLink">
  <ng-container *ngTemplateOutlet="content"></ng-container>
</a>

<ng-template #content>
  <my-loader size="sm" [ngClass]="{ displayed: loading }" [loading]="loading"></my-loader>
  <my-global-icon *ngIf="icon && !loading" [iconName]="icon"></my-global-icon>

  <span *ngIf="label" class="button-label">{{ label }}</span>

  <ng-content></ng-content>
</ng-template>