<DataForm
  @dc={{dc}}
  @nspace={{nspace}}
  @item={{item}}
  @type="session"
  @onsubmit={{action onsubmit}}
  as |api|
>
  <BlockSlot @name="form">
      <div
        class="consul-lock-session-form definition-table"
        data-test-session={{api.data.ID}}
        ...attributes
      >
        <h2>
          <a href="{{env 'CONSUL_DOCS_URL'}}/internals/sessions.html#session-design" rel="help noopener noreferrer" target="_blank">Lock Session</a>
        </h2>
        <dl>
{{#if api.data.Name}}
          <dt>Name</dt>
          <dd>{{api.data.Name}}</dd>
{{/if}}
          <dt>ID</dt>
          <dd>{{api.data.ID}}</dd>
          <dt>Node</dt>
          <dd>
              <a href={{href-to 'dc.nodes.show' api.data.Node}}>{{api.data.Node}}</a>
          </dd>
          <dt>Delay</dt>
          <dd>{{duration-from api.data.LockDelay}}</dd>
          <dt>TTL</dt>
          <dd>{{or api.data.TTL '-'}}</dd>
          <dt>Behavior</dt>
          <dd>{{api.data.Behavior}}</dd>
{{#let (union api.data.NodeChecks api.data.ServiceChecks) as |checks|}}
          <dt>Health Checks</dt>
          <dd>
  {{#if (gt checks.length 0)}}
              {{ join ', ' checks}}
  {{else}}
              -
  {{/if}}
          </dd>
{{/let}}
        </dl>
        <ConfirmationDialog @message="Are you sure you want to invalidate this session?">
          <BlockSlot @name="action" as |confirm|>
            <button type="button" data-test-delete class="type-delete" {{action confirm api.delete session}} disabled={{api.disabled}}>Invalidate Session</button>
          </BlockSlot>
          <BlockSlot @name="dialog" as |execute cancel message|>
            <p>
              {{message}}
            </p>
            <button type="button" class="type-delete" {{action execute}}>Confirm Invalidation</button>
            <button type="button" class="type-cancel" {{action cancel}}>Cancel</button>
          </BlockSlot>
        </ConfirmationDialog>
      </div>
    </BlockSlot>
</DataForm>