<of-error-message [error]="error$ | async" [closable]="false"></of-error-message>
<of-block-progressbar [target]="content" [pending]="pending$ | async"></of-block-progressbar>

<p-panel #content [showHeader]="false" class="block-panel">

  <div class="ui-g">
    <div class="ui-g-6 ui-nopad">
      <h3>General</h3>
    </div>

    <div class="ui-g-6 nopad" dir="rtl" style="padding-top: 15px">
      <button class="ui-button-width-fit" *ngIf="!editMode" pButton type="button" label="Edit" (click)="editMode = true"></button>
      <button class="ui-button-width-fit" *ngIf="editMode" pButton type="button" label="Save" (click)="onEditSave()" [disabled]="namenameErrMsg || descriptionErrMsg"></button>
      <button class="ui-button-width-fit" *ngIf="editMode" pButton type="button" label="Cancel" (click)="editMode = false"></button>
    </div>
  </div>

  <!-- Probe info -->
  <div class="ui-g ui-bottom-space-10">
    <div class="ui-g-12 ui-nopad">
      <p-panel [showHeader]="false">
        <div *ngIf="probe">
          <div class="ui-g">
            <div class="ui-g-12 ui-md-6 ui-key-value">
              <div *ngIf="editMode" class="of-key-value-div">
                <span>Name</span>
                <span class="ng-star-inserted">
                  <input #name type="text" pInputText value="{{probe.name}}" (keyup)="onNameEditing(name.value)" />
                  <div *ngIf="nameErrMsg" class="ui-message ui-messages-error ui-corner-all">{{nameErrMsg}}</div>
                </span>
              </div>
              <of-key-value *ngIf="!editMode" [key]="'Name'" [value]="probe.name"></of-key-value>
            </div>

            <div class="ui-g-12 ui-md-6 ui-key-value">
              <of-key-value [key]="'CIDR'" [value]="probe.cidr"></of-key-value>
            </div>
            <div class="ui-g-12 ui-md-6 ui-key-value">
              <div *ngIf="editMode" class="of-key-value-div">
                <span>Description</span>
                <span class="ng-star-inserted">
                  <input #description type="text" pInputText value="{{probe.description}}" (keyup)="onDescriptionEditing(description.value)"
                  />
                  <div *ngIf="descriptionErrMsg" class="ui-message ui-messages-error ui-corner-all">{{descriptionErrMsg}}</div>
                </span>
              </div>
              <of-key-value *ngIf="!editMode" [key]="'Description'" [value]="probe.description"></of-key-value>
            </div>
            <div class="ui-g-12 ui-md-6 ui-key-value">
              <of-key-value [key]="'Key'" [value]="probe.probeKey"></of-key-value>
            </div>
            <div class="ui-g-12 ui-md-6 ui-key-value">
              <of-key-value [key]="'Authrozied at'" [value]="probe.authorizeDate | date: 'dd/MM/yyyy'"></of-key-value>
            </div>
            <div class="ui-g-12 ui-md-6 ui-key-value">
              <of-key-value [key]="'Authrozied by'" [value]="probe.authorizeMember.name"></of-key-value>
            </div>
          </div>
        </div>
      </p-panel>
    </div>
  </div>
</p-panel>


<!-- <p-confirmDialog header="Confirmation" icon="fa ui-icon-warning" width="425"></p-confirmDialog>
<p-growl [(value)]="msgs"></p-growl> -->