<Sidebar::Section
  @sectionName="messages"
  @headerActionIcon="plus"
  @headerActions={{array
    (hash
      action=(fn (route-action "composePrivateMessage") null null)
      title=(i18n "sidebar.sections.messages.header_action_title")
    )
  }}
  @headerActionsIcon="plus"
  @headerLinkText={{i18n "sidebar.sections.messages.header_link_text"}}
  @collapsable={{@collapsable}}
>

  {{#each this.personalMessagesSectionLinks as |personalMessageSectionLink|}}
    {{#if personalMessageSectionLink.shouldDisplay}}
      <Sidebar::SectionLink
        @linkName={{personalMessageSectionLink.name}}
        @class={{personalMessageSectionLink.class}}
        @route={{personalMessageSectionLink.route}}
        @model={{personalMessageSectionLink.model}}
        @prefixType={{personalMessageSectionLink.prefixType}}
        @prefixValue={{personalMessageSectionLink.prefixValue}}
        @currentWhen={{personalMessageSectionLink.currentWhen}}
        @content={{personalMessageSectionLink.text}}
      />
    {{/if}}
  {{/each}}

  {{#if (gt this.groupMessagesSectionLinks.length 0)}}
    {{#each this.groupMessagesSectionLinks as |groupMessageSectionLink|}}
      {{#if groupMessageSectionLink.shouldDisplay}}
        <Sidebar::SectionLink
          @linkName={{groupMessageSectionLink.name}}
          @class={{groupMessageSectionLink.class}}
          @route={{groupMessageSectionLink.route}}
          @prefixType={{groupMessageSectionLink.prefixType}}
          @prefixValue={{groupMessageSectionLink.prefixValue}}
          @models={{groupMessageSectionLink.models}}
          @currentWhen={{groupMessageSectionLink.currentWhen}}
          @content={{groupMessageSectionLink.text}}
        />
      {{/if}}
    {{/each}}
  {{/if}}

</Sidebar::Section>