{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}
<Breadcrumb @crumb={{hash label=this.model.name args=(array "administration.namespaces.acl-namespace" this.model.name)}} />
{{page-title "Namespace"}}

<section class="section">
  <Hds::PageHeader as |PH|>
    <PH.Title data-test-title>{{this.model.name}}</PH.Title>
    {{#if (and (not (eq this.model.name "default"))  (can "destroy namespace"))}}
      <PH.Actions>
        <TwoStepButton
          data-test-delete-namespace
          @idleText="Delete Namespace"
          @cancelText="Cancel"
          @confirmText="Yes, Delete Namespace"
          @confirmationMessage="Are you sure?"
          @awaitingConfirmation={{this.deleteNamespace.isRunning}}
          @disabled={{this.deleteNamespace.isRunning}}
          @onConfirm={{perform this.deleteNamespace}}
        />
      </PH.Actions>
    {{/if}}
  </Hds::PageHeader>

  <Hds::Alert @type="inline" @color="highlight" @icon="info" class="related-entities notification" as |A|>
    <A.Title>Related Resources</A.Title>
    <A.Description>
      View this namespace's <<Hds::Link::Inline @route="jobs" @query={{hash namespace=this.model.name}}>jobs</<Hds::Link::Inline>
        or <<Hds::Link::Inline @route="variables" @query={{hash namespace=this.model.name}}>variables</<Hds::Link::Inline>.
    </A.Description>
  </Hds::Alert>

  <NamespaceEditor @namespace={{this.model}} />
</section>
