<div myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [dataObservable]="onSearchDataSubject.asObservable()" class="search-result">
  <div class="results-header">
    <div class="first-line">
      <div class="results-counter" *ngIf="pagination.totalItems">
        <span class="me-1" i18n>{{ pagination.totalItems | myNumberFormatter }} {pagination.totalItems, plural, =1 {result} other {results}}</span>

        <span class="me-1" i18n *ngIf="advancedSearch.searchTarget === 'local'">on this instance</span>
        <span class="me-1" i18n *ngIf="advancedSearch.searchTarget === 'search-index'">on the vidiverse</span>

        <span *ngIf="currentSearch" i18n>for <span class="search-value">{{ currentSearch }}</span></span>
      </div>

      <button
        class="results-filter-button button-unstyle ms-auto" (click)="isSearchFilterCollapsed = !isSearchFilterCollapsed"
        [attr.aria-expanded]="!isSearchFilterCollapsed" aria-controls="collapseBasic"
      >
        <span class="icon icon-filter"></span>
        <ng-container i18n>
          Filters
          <span *ngIf="numberOfFilters() > 0" class="pt-badge badge-secondary">{{ numberOfFilters() }}</span>
        </ng-container>
      </button>
    </div>

    <div class="results-filter" [ngbCollapse]="isSearchFilterCollapsed" [animation]="true">
      <my-search-filters [advancedSearch]="advancedSearch" (filtered)="onFiltered()"></my-search-filters>

      <div *ngIf="error" class="alert alert-danger">{{ error }}</div>
    </div>
  </div>

  <div i18n *ngIf="pagination.totalItems === 0 && results.length === 0" class="no-results">
    No results found
  </div>

  <ng-container *ngFor="let result of results">
    <div *ngIf="isVideoChannel(result)" class="entry video-channel">

      <my-actor-avatar
        [actor]="result" actorType="channel" responseSize="true"
        [internalHref]="getInternalChannelUrl(result)" [href]="getExternalChannelUrl(result)" size="120"
      ></my-actor-avatar>

      <div class="video-channel-info">
        <a *ngIf="!isExternalChannelUrl()" [routerLink]="getInternalChannelUrl(result)" class="video-channel-names">
          <ng-container *ngTemplateOutlet="aContent"></ng-container>
        </a>

        <a *ngIf="isExternalChannelUrl()" [href]="getExternalChannelUrl(result)" target="_blank" class="video-channel-names">
          <ng-container *ngTemplateOutlet="aContent"></ng-container>
        </a>

        <ng-template #aContent>
          <div class="video-channel-display-name me-2">{{ result.displayName }}</div>
          <div class="video-channel-name">{{ result.nameWithHost }}</div>
        </ng-template>

        <div i18n class="video-channel-followers">{{ result.followersCount }} subscribers</div>
      </div>

      <my-subscribe-button *ngIf="!hideActions()" [videoChannels]="[result]"></my-subscribe-button>
    </div>

    <div *ngIf="isVideo(result)" class="entry video">
      <my-video-miniature
        [video]="result" [user]="userMiniature" [displayAsRow]="true" [displayVideoActions]="!hideActions()"
        [displayOptions]="videoDisplayOptions" [videoLinkType]="getLinkType()"
        (videoBlocked)="removeVideoFromArray(result)" (videoRemoved)="removeVideoFromArray(result)"
      ></my-video-miniature>
    </div>

    <div *ngIf="isPlaylist(result)" class="entry video-playlist">
      <my-video-playlist-miniature
        [playlist]="result" [displayAsRow]="true" [displayChannel]="true"
        [linkType]="getLinkType()"
      ></my-video-playlist-miniature>
    </div>
  </ng-container>

</div>
