<ng-container *ngVar="(bitstreamRD$ | async) as bitstreamRD">
  <div class="container">
    <div class="row" *ngIf="bitstreamRD?.hasSucceeded">
      <div class="col-md-2">
        <ds-themed-thumbnail [thumbnail]="bitstreamRD?.payload"></ds-themed-thumbnail>
      </div>
      <div class="col-md-10">
        <div class="container">
          <div class="row">
            <div class="col-12">
              <h1 class="h2">{{dsoNameService.getName(bitstreamRD?.payload)}} <span class="text-muted">({{bitstreamRD?.payload?.sizeBytes | dsFileSize}})</span></h1>
            </div>
          </div>
        </div>
        <ds-form *ngIf="formGroup" [formId]="'edit-bitstream-form-id'"
                  [formGroup]="formGroup"
                  [formModel]="formModel"
                  [formLayout]="formLayout"
                  [submitLabel]="'form.save'"
                  (submitForm)="onSubmit()"
                  (cancel)="onCancel()"
                  (dfChange)="onChange($event)">
          <div additional class="container py-3">
            <a [routerLink]="['/bitstreams', bitstreamRD?.payload?.id, 'authorizations']">{{'bitstream.edit.authorizations.link' | translate}}</a>
          </div>
        </ds-form>
      </div>
    </div>
    <ds-error *ngIf="bitstreamRD?.hasFailed" message="{{'error.bitstream' | translate}}"></ds-error>
    <ds-themed-loading *ngIf="!bitstreamRD || bitstreamRD?.isLoading"
                message="{{'loading.bitstream' | translate}}"></ds-themed-loading>
  </div>
</ng-container>
