<div class="margin-content">
  <div class="videos-header">
    <div *ngIf="headerActions().length !== 0" class="action-block mb-4">
      <ng-container *ngFor="let action of headerActions()">
        @if (action.routerLink) {
          <my-button theme="secondary" [ptRouterLink]="action.routerLink" [icon]="action.iconName">{{ action.label }}</my-button>
        }
      </ng-container>
    </div>
  </div>

  <my-video-filters-header
    *ngIf="displayFilters()" class="d-block"
    [displayModerationBlock]="displayModerationBlock" [hideScope]="hideScopeFilter()" [filters]="filters"
  ></my-video-filters-header>

  <div class="no-results" i18n *ngIf="hasDoneFirstQuery && videos.length === 0 && highlightedLives.length === 0">No results.</div>

  <div
    myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [dataObservable]="onVideosDataSubject.asObservable()"
    class="videos" [ngClass]="{ 'display-as-row': displayAsRow() }"
  >
    <ng-container *ngIf="highlightedLives.length !== 0">
      <h2 class="date-title">
        <my-global-icon class="pt-icon me-1 top--1px" iconName="live"></my-global-icon>
        <ng-container i18n>Lives</ng-container>
      </h2>

      <ng-container *ngFor="let live of highlightedLives; trackBy: videoById;">
        <div class="video-wrapper">
          <my-video-miniature
            [video]="live" [user]="user" [displayAsRow]="displayAsRow()"
            [displayVideoActions]="displayVideoActions()" [displayOptions]="displayOptions"
            (videoBlocked)="removeVideoFromArray(live)" (videoRemoved)="removeVideoFromArray(live)"
          >
          </my-video-miniature>
        </div>
      </ng-container>

      <h2 *ngIf="!groupByDate()" class="date-title">
        <my-global-icon class="pt-icon me-1" iconName="videos"></my-global-icon> Videos
      </h2>
    </ng-container>

    <ng-container *ngFor="let video of videos; trackBy: videoById;">
      <h2 class="date-title" *ngIf="getCurrentGroupedDateLabel(video)">
        {{ getCurrentGroupedDateLabel(video) }}
      </h2>

      <div class="video-wrapper">
        <my-video-miniature
          [video]="video" [user]="user" [displayAsRow]="displayAsRow()"
          [displayVideoActions]="displayVideoActions()" [displayOptions]="displayOptions"
          (videoBlocked)="removeVideoFromArray(video)" (videoRemoved)="removeVideoFromArray(video)"
        >
        </my-video-miniature>
      </div>
    </ng-container>
  </div>
</div>
