<div class='section_header mg-t-0 mg-b-1 flex flex--verticalCenter'>
  <h3 class='title'>{{t 'frontPage.pulse.title'}}</h3><span class='mg-l-1 pill'>{{t 'general.common.beta'}}</span>
</div>

{{#if loading}}
  <div class='loading-spinner-container align-center'><div class='loading-spinner'></div></div>
{{else if error}}
  <div class='empty-grid'>
    {{i18n 'There was an error loading the newsfeed.'}}
  </div>
{{else}}
  {{#if showOnboardingExperience}}
    <div class='brick mg-b-2 pd-r-4 pos-relative'>
      <span>{{t 'frontPage.pulse.onboardingMessage'}}</span>
      <span><a href='https://goo.gl/forms/10UmDHQE4m1NinAq1' target='_blank' rel="noopener noreferrer">{{i18n ' Tell us what you think!'}}</a></span>
      <button class='pin-tr button button--icon-only button--secondary' {{action 'closeCommentsOnboarding'}}>
        {{svg-icon path='svg/close-small'}}
      </button>
    </div>
  {{/if}}
  {{twitch-feed/composer
      class='mg-b-2'
      placeholderText=(i18n 'Post an update to your friends & followers!')
      createMessage=(action 'createPost')
      maxLength=9000
      showCreateActions=true
      liveEmbed=true
      textAreaFocus=true
      trackingInfo=(create-context trackingInfo)
  }}
  {{#each posts as |post index|}}
    {{twitch-feed/story-card
      post=post
      onOpenPost=onOpenPost
      deleteAction=(action 'deletePost')
      truncatePostAfter=800
      numPostPreviewLines=10
      activeUserDataLinks=true
      showFriendButton=true
      enableAutoplay=false
      trackingInfo=(create-context trackingInfo feed_index=(plus-one index))
    }}
  {{/each}}
{{/if}}
{{#if loadingMore}}
  <div class='loading-spinner-container align-center'><div class='loading-spinner'></div></div>
{{else}}
  {{infinite-scroll-slug
    loadMore=(action 'loadMore')
    buffer=500
    isLoading=loadingMore
    contentLength=posts.length
  }}
{{/if}}
{{yield}}
