<form (ngSubmit)="save()">
  <h1 mat-dialog-title>
    {{ dialogData.simpleCounter.title }} – {{ T.MH.SETTINGS | translate }}
  </h1>

  <mat-dialog-content>
    <formly-form
      [fields]="fields"
      [form]="form"
      [(model)]="model"
      [options]="formOptions"
    >
    </formly-form>
  </mat-dialog-content>

  <mat-dialog-actions>
    @if (dialogData.simpleCounter.id) {
      <button
        mat-button
        color="warn"
        type="button"
        (click)="delete()"
      >
        <mat-icon>delete</mat-icon>
        {{ T.G.DELETE | translate }}
      </button>
    }
    <span style="flex: 1"></span>
    <button
      mat-button
      type="button"
      (click)="close()"
    >
      {{ T.G.CANCEL | translate }}
    </button>
    <button
      mat-flat-button
      color="primary"
      type="submit"
      [disabled]="!isDirty()"
    >
      <mat-icon>save</mat-icon>
      {{ T.G.SAVE | translate }}
    </button>
  </mat-dialog-actions>
</form>
