<section class="header">
  <h1>
    {{#if isNew}}
      {{t "globalDnsPage.providersPage.header.new"}}
    {{else if isEdit}}
      {{t "globalDnsPage.providersPage.header.edit"}}
    {{/if}}
  </h1>
</section>

<section class="pt-10">
  <div class="row nav nav-boxes checked-active">
    {{#each availableProviders as |provider|}}
      <a
        {{action "switchProvider" provider.name}}
        alt={{provider.name}}
        class="mb-20 col span-2 nav-box-item driver generic {{if (eq provider.name activeProvider) "active"}}"
        href="#"
      >
        <div class="machine-driver {{provider.name}}"></div>
        <p class="mb-0">
          {{provider.name}}
        </p>
        {{#if (eq provider.name "cloudflare")}}
          <span class="inline-block help-block">
            {{t "generic.experimental"}}
          </span>
        {{/if}}
      </a>
    {{/each}}
  </div>
</section>

<hr class="mt-20 mb-20" />

{{#accordion-list as |al expandFn|}}
  {{#accordion-list-item
     title=(t "globalDnsPage.providersPage.options.title")
     detail=(t "globalDnsPage.providersPage.options.detail")
     expandAll=al.expandAll
     expand=(action expandFn)
     expandOnInit=true
     everExpanded=true
     showExpand=false
  }}
    {{partial (concat activeProvider "-dns-provider") }}
  {{/accordion-list-item}}


  {{#accordion-list-item
     title=(t "globalDnsPage.providersPage.members.title")
     detail=(t "globalDnsPage.providersPage.members.detail")
     expandAll=al.expandAll
     expand=(action expandFn)
  }}
    {{form-members-global-access
      optionsForAccessType=memberAccessTypes
      readOnly=false
      resource=model
      addAuthorizedPrincipal=(action "addAuthorizedPrincipal")
      removeMember=(action "removeMember")
    }}
  {{/accordion-list-item}}

{{/accordion-list}}

<section>
  {{top-errors errors=errors}}
  {{save-cancel
    cancel=(action "cancel")
    classNames="text-center mt-20"
    save=(action "save")
    editing=isEdit
    saveDisabled=saveDisabled
  }}
</section>
