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

<div class="field is-fullwidth box is-bottomless {{if (eq @includeBox false) 'is-shadowless'}}">
  <Hds::ButtonSet>
    <Hds::Button
      @text={{or @saveButtonText "Save"}}
      @icon={{if @isSaving "loading"}}
      type="submit"
      data-test-edit-form-submit
      disabled={{@isSaving}}
    />
    {{#if this.cancelLink}}
      <Hds::Button
        @text={{or @cancelButtonText "Cancel"}}
        @color="secondary"
        @route={{this.cancelLink.route}}
        @models={{this.cancelLink.models}}
      />
    {{/if}}
    {{#if @onCancel}}
      <Hds::Button
        @text={{or @cancelButtonText "Cancel"}}
        @color="secondary"
        {{on "click" @onCancel}}
        data-test-cancel-button
      />
    {{/if}}
  </Hds::ButtonSet>
  {{yield to="error"}}
</div>