<label for="choose-message-title">{{i18n "choose_message.title.search"}}</label>

<TextField
  @value={{this.messageTitle}}
  @placeholderKey="choose_message.title.placeholder"
  @id="choose-message-title"
/>

{{#if this.loading}}
  <p>{{i18n "loading"}}</p>
{{else}}
  {{#if this.noResults}}
    <p>{{i18n "choose_message.none_found"}}</p>
  {{else}}
    {{#each this.messages as |m|}}
      <div class="controls existing-message">
        <label class="radio">
          <input
            id="choose-message-{{m.id}}"
            {{on "click" (fn this.chooseMessage m)}}
            type="radio"
            name="choose_message_id"
          />
          <span class="message-title">
            {{m.title}}
          </span>
        </label>
      </div>
    {{/each}}
  {{/if}}
{{/if}}