@if (item) {
  <div class="item-page" @fadeInOut>
    <ds-badges [object]="item" [context]="badgeContext"></ds-badges>
    @if (item) {
      <div>
        <ds-item-page-title-field [item]="item">
        </ds-item-page-title-field>
        <div class="row mb-1">
          <div class="col-xs-12 col-md-4">
            <ds-metadata-field-wrapper [hideIfNoTextContent]="false">
              <ds-thumbnail [thumbnail]="item?.thumbnail | async"></ds-thumbnail>
            </ds-metadata-field-wrapper>
            @if ((bitstreams$ | async); as bitstreams) {
              <ds-metadata-field-wrapper [label]="('item.page.files' | translate)">
                @if (bitstreams?.length > 0) {
                  <div class="file-section">
                    @for (file of bitstreams; track file; let last = $last) {
                      <button class="btn btn-link" (click)="downloadBitstreamFile(file?.uuid)">
                        <span>{{ dsoNameService.getName(file) }}</span>
                        <span>({{(file?.sizeBytes) | dsFileSize }})</span>
                        @if (!last) {
                          <span innerHTML="{{separator}}"></span>
                        }
                      </button>
                    }
                  </div>
                }
                @if (bitstreams?.length === 0) {
                  <span class="text-muted">{{('mydspace.results.no-files' | translate)}}</span>
                }
              </ds-metadata-field-wrapper>
            }
            <ds-item-detail-preview-field [item]="item"
                                          [object]="object"
                                          [label]="('item.page.date' | translate)"
                                          [metadata]="'dc.date.issued'"
                                          [separator]="separator"
                                          [placeholder]="('mydspace.results.no-date' | translate)">
            </ds-item-detail-preview-field>
            <ds-item-detail-preview-field [item]="item"
                                          [object]="object"
                                          [label]="('item.page.authors' | translate)"
                                          [metadata]="['dc.contributor', 'dc.creator', 'dc.contributor.*']"
                                          [separator]="separator"
                                          [placeholder]="('mydspace.results.no-authors' | translate)">
            </ds-item-detail-preview-field>
          </div>
          <div class="col-xs-12 col-md-6">
            <ds-item-detail-preview-field [item]="item"
                                          [object]="object"
                                          [label]="('item.page.abstract' | translate)"
                                          [metadata]="'dc.description.abstract'"
                                          [separator]="separator"
                                          [placeholder]="('mydspace.results.no-abstract' | translate)">
            </ds-item-detail-preview-field>
            <ds-item-detail-preview-field [item]="item"
                                          [object]="object"
                                          [label]="('item.page.uri' | translate)"
                                          [metadata]="'dc.identifier.uri'"
                                          [separator]="separator"
                                          [placeholder]="('mydspace.results.no-uri' | translate)">
            </ds-item-detail-preview-field>
            <div>
              <ng-content></ng-content>
            </div>
          </div>
        </div>
      </div>
    }
  </div>
}
@if (showSubmitter) {
  <ds-item-submitter [object]="object.indexableObject"></ds-item-submitter>
}
