<div class='convoHeader flex flex--verticalCenter' {{action 'toggleCollapsed'}} tabindex="0">

  <div class="convoHeader--user mg-l-1 ellipsis">
    <span class="username">
      {{#if headerBadges}}
        <span class="badges">
          {{#each headerBadges as |badge|}}
            <img src={{badge.src}} srcset={{badge.srcSet}} class="badge" title={{badge.title}}>
          {{/each}}
        </span>
      {{/if}}
      {{otherDisplayName}}

      {{#if isFriend}}
        {{twitch-friends-list/twitch-friend-online-status userId=otherUser.id}}
        {{twitch-friends-list/twitch-friend-rich-presence userId=otherUser.id}}
      {{/if}}
    </span>
  </div>

  <div class='convoHeader__buttons flex__item flex flex--nowrap flex--verticalCenter {{if hasUnread 'theme--dark'}}' >
    {{#if (not conversation.isCollapsed)}}
      <a class='convo__button button button--icon-only conversation-settings-menu-toggle' {{action 'toggleSettings' bubbles=false}}>
        {{svg-icon path='svg/gear' iconModifier='icon--gear'}}
      </a>
    {{/if}}
    <a class='convo__button button button--icon-only ' {{action 'closeConversation' bubbles=false}}>
      {{svg-icon path='svg/close'}}
    </a>
  </div>

  <div class='conversation-settings-menu-container hidden'>
    {{twitch-conversations/conversation-settings-menu
      thread=thread
      openInModal='openInModal'
      closeModal='closeModal'
    }}
  </div>

</div>

{{#if shouldShowSpamCTA}}
  {{twitch-conversations/spam-cta
    conversation=conversation
  }}
{{/if}}

<div class='conversation-content'>
  {{twitch-conversations/conversation-chat-display
    conversation=conversation
    messageIdBeforeDivider=messageIdBeforeDivider
    isLoadingMessages=isLoadingMessages
  }}
</div>
{{twitch-conversations/conversation-input placeholder=chatPlaceholder allEmotes=allUserEmotes thread=thread tabIndex=tabIndex}}
