{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

<div class="field is-fullwidth box is-bottomless {{if (eq @includeBox false) 'is-shadowless'}}">
  <div class="field is-grouped">
    <div class="control">
      <button
        type="submit"
        data-test-edit-form-submit
        class="button is-primary {{if @isSaving 'loading'}}"
        disabled={{@isSaving}}
      >
        {{or @saveButtonText "Save"}}
      </button>
    </div>
    {{#if this.cancelLink}}
      <div class="control">
        <LinkTo @route={{this.cancelLink.route}} @models={{this.cancelLink.models}} class="button">
          {{or @cancelButtonText "Cancel"}}
        </LinkTo>
      </div>
    {{/if}}
    {{#if @onCancel}}
      <div class="control">
        <button type="button" class="button" onclick={{action @onCancel}} data-test-cancel-button>
          {{or @cancelButtonText "Cancel"}}
        </button>
      </div>
    {{/if}}
  </div>
  {{yield to="error"}}
</div>