{{!
  Copyright IBM Corp. 2016, 2025
  SPDX-License-Identifier: BUSL-1.1
}}

{{#if (has-feature "Control Groups")}}
  <PageHeader as |p|>
    <p.levelLeft>
      <h1 class="title is-3">
        Control Groups
      </h1>
    </p.levelLeft>
  </PageHeader>
  {{#if this.model.canConfigure}}
    <Toolbar>
      <ToolbarActions>
        <ToolbarLink @route="vault.cluster.access.control-groups-configure">
          Configure
        </ToolbarLink>
      </ToolbarActions>
    </Toolbar>
  {{/if}}
  <form {{action (nav-to-route "vault.cluster.access.control-group-accessor" this.model.id) on="submit"}}>
    <div class="box is-sideless is-fullwidth is-marginless">
      <p class="has-text-grey is-size-8">
        Control Groups add additional authorization factors to be required before satisfying a request. If you have a Control
        Group accessor, provide it here to view the lookup the authorization progress.
      </p>
      <label for="accessor" class="is-label">
        Accessor
      </label>
      <div class="control">
        <Input class="input" autocomplete="off" spellcheck="false" name="accessor" @value={{this.model.id}} />
      </div>
    </div>
    <div class="field is-grouped box is-fullwidth is-bottomless">
      <Hds::Button @text="Lookup" type="submit" disabled={{not this.model.id}} />
    </div>
  </form>
{{else}}
  <UpgradePage @title="Control Groups" @minimumEdition="Vault Enterprise Premium" />
{{/if}}