<ng-container *ngVar="(bitstreamRD$ | async) as bitstreamRD">
  <div class="container" *ngVar="(bitstreamFormatsRD$ | async) as formatsRD">
    <div class="row" *ngIf="bitstreamRD?.hasSucceeded && formatsRD?.hasSucceeded">
      <div class="col-md-2">
        <ds-thumbnail [thumbnail]="bitstreamRD?.payload"></ds-thumbnail>
      </div>
      <div class="col-md-10">
        <div class="container">
          <div class="row">
            <div class="col-12">
              <h3>{{bitstreamRD?.payload?.name}} <span class="text-muted">({{bitstreamRD?.payload?.sizeBytes | dsFileSize}})</span></h3>
            </div>
          </div>
        </div>
        <ds-form  [formId]="'edit-bitstream-form-id'"
                  [formGroup]="formGroup"
                  [formModel]="formModel"
                  [formLayout]="formLayout"
                  [submitLabel]="'form.save'"
                  (submitForm)="onSubmit()"
                  (cancel)="onCancel()"
                  (dfChange)="onChange($event)"></ds-form>
      </div>
    </div>
    <ds-error *ngIf="bitstreamRD?.hasFailed" message="{{'error.bitstream' | translate}}"></ds-error>
    <ds-loading *ngIf="!bitstreamRD || !formatsRD || bitstreamRD?.isLoading || formatsRD?.isLoading"
                message="{{'loading.bitstream' | translate}}"></ds-loading>
  </div>
</ng-container>
