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

<div class="box is-fullwidth is-sideless is-paddingless is-marginless">
  {{#each @model.fieldGroups as |fieldGroup|}}
    {{#each-in fieldGroup as |group fields|}}
      {{#if (or (eq group "default") (eq group "Options"))}}
        {{#each fields as |attr|}}
          {{#if (not (includes attr.options.fieldValue (array "id" "mutableId")))}}
            <InfoTableRow
              @alwaysRender={{@showAllFields}}
              @label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
            >
              {{#if attr.options.sensitive}}
                <span class="is-help">This value is sensitive and cannot be shown.</span>
              {{else}}
                {{get @model attr.name}}
              {{/if}}
            </InfoTableRow>
          {{/if}}
        {{/each}}
      {{else}}
        <div class="box {{unless @showAllFields 'is-shadowless'}} is-fullwidth is-sideless is-marginless">
          <h2 class="title is-5">
            {{group}}
          </h2>
          {{#each fields as |attr|}}
            <InfoTableRow
              @alwaysRender={{@showAllFields}}
              @label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
            >
              {{#if attr.options.sensitive}}
                <span class="is-help">This value is sensitive and cannot be shown.</span>
              {{else}}
                {{get @model attr.name}}
              {{/if}}
            </InfoTableRow>
          {{/each}}
        </div>
      {{/if}}
    {{/each-in}}
  {{/each}}
</div>