{{#if this.searchEnabled}}
  <div class="semantic-search__container search-results" role="region">
    <div
      class="semantic-search__results"
      {{did-insert this.setup}}
      {{did-insert this.debouncedSearch}}
      {{will-destroy this.teardown}}
    >
      {{#if this.searching}}
        <div class="semantic-search__searching">
          <div class="semantic-search__searching-text">
            {{i18n "discourse_ai.embeddings.semantic_search_loading"}}
          </div>
          <span class="semantic-search__indicator-wave">
            <span class="semantic-search__indicator-dot">.</span>
            <span class="semantic-search__indicator-dot">.</span>
            <span class="semantic-search__indicator-dot">.</span>
          </span>
        </div>
      {{else}}
        {{#if this.results.length}}
          <div class="semantic-search__toggle-button-container">
            <DButton
              @translatedTitle={{this.collapsedResultsTitle}}
              @translatedLabel={{this.collapsedResultsTitle}}
              @action={{fn
                (mut this.collapsedResults)
                (not this.collapsedResults)
              }}
              @class="btn-flat"
              @icon={{if this.collapsedResults "chevron-right" "chevron-down"}}
            />
          </div>

          {{#unless this.collapsedResults}}
            <div class="semantic-search__entries">
              <SearchResultEntries
                @posts={{this.results}}
                @highlightQuery={{this.highlightQuery}}
              />
            </div>
          {{/unless}}
        {{else}}
          <div class="semantic-search__searching">
            {{i18n "discourse_ai.embeddings.semantic_search_results.none"}}
          </div>
        {{/if}}
      {{/if}}
    </div>
  </div>
{{/if}}