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

{{! template-lint-disable no-inline-styles }}
<div class="boxed-section is-small">
  <div class="boxed-section-body inline-definitions">
    <span class="label" style="width: 6.125rem;">Job Details</span>
    <span class="pair" data-test-job-stat="type">
      <span class="term">Type</span>
      {{@job.type}}
    </span>
    <span class="pair" data-test-job-stat="priority">
      <span class="term">Priority</span>
      {{@job.priority}}
    </span>
    <span class="pair" data-test-job-stat="version">
      <span class="term">Version</span>
      {{@job.version}}
    </span>
    {{#if (and (can "list variables") @job.pathLinkedVariable)}}
      <span class="pair" data-test-job-stat="variables">
        <LinkTo @route="variables.variable" @model={{@job.pathLinkedVariable.id}}>Variables</LinkTo>
      </span>
    {{/if}}
    {{yield to="before-namespace"}}
    {{#if (and @job.namespace this.system.shouldShowNamespaces)}}
      <span class="pair" data-test-job-stat="namespace">
        <span class="term">Namespace</span>
        {{@job.namespace.name}}
      </span>
    {{/if}}
    <span class="pair" data-test-job-stat="node-pool">
      <span class="term">Node Pool</span>
      {{#if @job.nodePool}}{{@job.nodePool}}{{else}}-{{/if}}
    </span>
    {{yield to="after-namespace"}}
  </div>

  {{#if @job.meta.structured.pack.name}}
    <div class="boxed-section-body inline-definitions">
      <span class="label" style="width: 6.125rem;">Pack Details</span>
      <span class="pair" data-test-pack-stat="name">
        <span class="term">Name</span>
        {{@job.meta.structured.pack.name}}
      </span>
      {{#if @job.meta.structured.pack.registry}}
        <span class="pair" data-test-pack-stat="registry">
          <span class="term">Registry</span>
          {{@job.meta.structured.pack.registry}}
        </span>
      {{/if}}
      {{#if @job.meta.structured.pack.version}}
        <span class="pair" data-test-pack-stat="version">
          <span class="term">Version</span>
          {{@job.meta.structured.pack.version}}
        </span>
      {{/if}}
      {{#if @job.meta.structured.pack.revision}}
        <span class="pair" data-test-pack-stat="revision">
          <span class="term">Revision</span>
          {{@job.meta.structured.pack.revision}}
        </span>
      {{/if}}
      {{yield to="pack"}}
    </div>
  {{/if}}
</div>
