<h4 mat-dialog-title>{{dialogTitle}}</h4>
<mat-dialog-content>
  <div style="margin-bottom: 10px;">
    <!-- We can support text dialogs or dialogs where users must select items from a list -->
    @if (dialogType === 'text') {
      {{dialogText}}
    }
    @if (dialogType === 'selection_list') {
      <mat-selection-list [(ngModel)]="selected_items">
        @for (item of list; track item) {
          <mat-list-option [value]="item.key">
            {{item.title}}
          </mat-list-option>
        }
      </mat-selection-list>
    }
  </div>
</mat-dialog-content>
<mat-dialog-actions>
  <!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->
  <button [disabled]="dialogType === 'selection_list' && selected_items.length === 0" [color]="warnSubmitColor ? 'warn' : 'primary'" mat-flat-button type="submit" (click)="confirmClicked()">{{submitText}}</button>
  @if (submitClicked) {
    <div class="mat-spinner">
      <mat-spinner [diameter]="25"></mat-spinner>
    </div>
  }
  <span class="spacer"></span>
  <button style="float: right;" mat-stroked-button mat-dialog-close>
    {{cancelText}}
  </button>
</mat-dialog-actions>