<div class="footer">
  <ng-container *ngIf="!cipher.decryptionFailure">
    <button
      #submitBtn
      form="cipherForm"
      type="submit"
      [hidden]="action === 'view'"
      bitButton
      class="primary"
      appA11yTitle="{{ 'save' | i18n }}"
    >
      {{ "save" | i18n }}
    </button>
    <button
      type="button"
      class="primary"
      (click)="edit()"
      appA11yTitle="{{ 'edit' | i18n }}"
      *ngIf="!cipher.isDeleted && action === 'view'"
    >
      <i class="bwi bwi-pencil bwi-fw bwi-lg" aria-hidden="true"></i>
    </button>
    <button
      *ngIf="action === 'edit' || action === 'clone' || action === 'add'"
      type="button"
      (click)="cancel()"
    >
      {{ "cancel" | i18n }}
    </button>
    <button
      type="button"
      class="primary"
      (click)="restore()"
      appA11yTitle="{{ 'restore' | i18n }}"
      *ngIf="cipher.isDeleted && cipher.permissions.restore"
    >
      <i class="bwi bwi-undo bwi-fw bwi-lg" aria-hidden="true"></i>
    </button>
    <button
      type="button"
      class="primary"
      *ngIf="cipher.id && !cipher?.organizationId && !cipher.isDeleted && action === 'view'"
      (click)="clone()"
      appA11yTitle="{{ 'clone' | i18n }}"
    >
      <i class="bwi bwi-files bwi-fw bwi-lg" aria-hidden="true"></i>
    </button>
  </ng-container>
  <div class="right" *ngIf="cipher.permissions.delete && (action === 'edit' || action === 'view')">
    <button
      type="button"
      (click)="delete()"
      class="danger"
      appA11yTitle="{{ (cipher.isDeleted ? 'permanentlyDelete' : 'delete') | i18n }}"
    >
      <i class="bwi bwi-trash bwi-lg bwi-fw" aria-hidden="true"></i>
    </button>
  </div>
</div>
