<div class="videos items highlights">
  {{#manager/video-manager channelName=model.channel.channelName videos=model.videos as |videoManager|}}

    {{#infinite-scroll loadMore=(route-action 'loadMoreHighlights')
      isLoading=model.isLoading
      contentLength=videoManager.allVideos.length
      classNames="tower tower--bleed tower--240 tower--gutter-sm" }}
      {{#each videoManager.allVideos as |video|}}
        {{#if manager.model.can_create_offline_playlist}}
          {{#playlist-draggable-item content=video.id}}
            {{videoManager.videoCard
              video=video
              editAction=(action videoManager.startEditingVideo video)
              downloadButton=true
              moreDelete=true
              moreExport=true
              moreRebroadcast=manager.model.can_rebroadcast
              managerProperties=manager.model
              isPastBroadcasts=false}}
          {{/playlist-draggable-item}}
        {{else}}
          {{videoManager.videoCard
            video=video
            editAction=(action videoManager.startEditingVideo video)
            downloadButton=true
            moreDelete=true
            moreExport=true
            moreRebroadcast=manager.model.can_rebroadcast
            managerProperties=manager.model
            isPastBroadcasts=false}}
        {{/if}}
      {{/each}}
      {{tower-placeholder}}
    {{/infinite-scroll}}

    {{#common/modal-dialog
      showModal=(or
        (isPresent videoManager.currentEditorVideo)
        (isPresent videoManager.videoStagedForDeletion)
      )
      size='container-md'}}
      <div>
        {{#if videoManager.currentEditorVideo}}
          {{#modal-dialog action=videoManager.stopEditingVideo size="containerMd" as |modal|}}
            {{manager/video-uploads/form
              video=videoManager.currentEditorVideo
              onComplete=modal.close}}
          {{/modal-dialog}}
        {{/if}}

        {{#if videoManager.videoStagedForDeletion}}
          {{manager/confirm-delete-video
            video=videoManager.videoStagedForDeletion
            onConfirm=videoManager.deleteVideo
            onDismiss=videoManager.clearVideoStagedForDeletion}}
        {{/if}}
      </div>
    {{/common/modal-dialog}}
  {{/manager/video-manager}}
</div>

{{#if model.isLoading}}
  {{loading-more-spinner}}
{{else if (not model.content)}}
  <p class='empty-grid' data-test-empty-message>
    {{i18n "No Highlights Found"}}
  </p>
{{/if}}
