<!--

    Copyright © 2016-2023 The Thingsboard Authors

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<mat-toolbar color="warn">
  <mat-icon>warning</mat-icon>
  <h2 translate>gateway.configuration-delete-dialog-header</h2>
  <span fxFlex></span>
  <button mat-icon-button
          (click)="close()"
          type="button">
    <mat-icon class="material-icons">close</mat-icon>
  </button>
</mat-toolbar>
<div mat-dialog-content style="max-width: 600px" class="mat-content" fxLayout="column">
  <span innerHTML="{{ 'gateway.configuration-delete-dialog-body' | translate }} <b>{{ gatewayName }}</b>" ></span>
  <mat-form-field class="mat-block tb-value-type" style="flex-grow: 0">
    <mat-label translate>gateway.configuration-delete-dialog-input</mat-label>
    <input matInput [formControl]="gatewayControl" required/>
    <mat-error
      *ngIf="gatewayControl.hasError('required')">
      {{ 'gateway.configuration-delete-dialog-input-required' | translate }}
    </mat-error>
  </mat-form-field>
</div>
<div mat-dialog-actions fxLayoutAlign="end center">
  <button mat-button color="warn"
          type="button"
          cdkFocusInitial
          (click)="close()">
    {{ 'action.cancel' | translate }}
  </button>
  <button mat-button color="warn"
          type="button"
          [disabled]="gatewayControl.value !== gatewayName"
          (click)="turnOff()">
    {{ 'gateway.configuration-delete-dialog-confirm' | translate }}
  </button>
</div>
