<ng-container *ngIf="data && data.objectController">
  <h1 mat-dialog-title>{{data.dialogTitle || '' }}</h1>
  <div mat-dialog-content class="fl-dialog" (scroll)="onDialogScroll($event)">
    <app-fl-backdrop *ngIf="executingAction" [dynamicTop]="loaderTop" overlayParent></app-fl-backdrop>
    <ng-template appComponentHost [component]="tab.component" [objectController]="data.objectController"
                 [componentTabIndex]="0" [detailsActions]="detailsData.detailsActions">
    </ng-template>
  </div>
  <div mat-dialog-actions>
    <ng-container *ngIf="detailsData.detailsActions; else noActions">
      <button [disabled]="executingAction" mat-button (click)="close()">Close</button>
      <ng-container *ngFor="let action of detailsData.detailsActions">
        <button mat-button *ngIf="action.type !== actionTypes.RouterLinkAction; else dialogBtnWithRouterLink"
                (click)="executeAction(action, $event)" (auxclick)="executeAction(action, $event)"
                [disabled]="action.noPermissions || action.isRunning || executingAction" [class.mat-primary]="action.primary">
          {{action.name}}
        </button>
        <ng-template #dialogBtnWithRouterLink>
          <a mat-button
             [disabled]="action.noPermissions || action.isRunning"
             [routerLink]="action.routerUrl"
             [queryParamsHandling]="action.queryParamsHandling"
             [fragment]="action.fragment"
             [queryParams]="action.queryParams"
             [class.mat-primary]="action.primary"
             *ngIf="action.type !== actionTypes.RouterLinkAction; else dialogBtnWithRouterLink">
            {{action.name}}
          </a>
        </ng-template>
      </ng-container>
    </ng-container>
    <ng-template #noActions>
      <button mat-button color="primary" (click)="close()" i18n>Close</button>
    </ng-template>
  </div>
</ng-container>
