{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: MPL-2.0
}}

{{#if (gt @sources.length 0)}}
  <BlockSlot @name='selected'>
    <span>
      {{t 'common.search.source'}}
    </span>
  </BlockSlot>
  <BlockSlot @name='options'>
    {{#let @components.Option as |Option|}}
      {{#each @sources as |source|}}
        {{#let (icon-mapping source) as |flightIcon|}}
          <Option
            class={{unless flightIcon source}}
            @value={{source}}
            @selected={{includes source @filter.source.value}}
          >
            {{#if flightIcon}}
              <FlightIcon @name={{flightIcon}} class='mr-2.5' />
            {{/if}}
            {{t (concat 'common.brand.' source)}}
          </Option>
        {{/let}}
      {{/each}}
    {{/let}}
  </BlockSlot>
{{/if}}
