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

{{page-title "Server " this.model.name}}
<ServerSubnav @server={{this.model}} />
<section class="section">
  <h1 data-test-title class="title">
    Server {{this.model.name}}
    {{#if this.model.isLeader}}
      <span data-test-leader-badge class="bumper-left tag is-primary">Leader</span>
    {{/if}}
  </h1>
  <div class="boxed-section is-small">
    <div data-test-server-details class="boxed-section-body inline-definitions">
      <span class="label">Server Details</span>
      <span data-test-status class="pair"><span class="term">Status</span>
        {{this.model.status}}
      </span>
      <span data-test-address class="pair"><span class="term">Address</span>
        {{this.model.rpcAddr}}
      </span>
      <span data-test-datacenter class="pair"><span class="term">Datacenter</span>
        {{this.model.datacenter}}
      </span>
    </div>
  </div>
  <div class="boxed-section">
    <div class="boxed-section-head">
      Server Tags
    </div>
    <div class="boxed-section-body is-full-bleed">
      <ListTable @source={{this.sortedTags}} @class="is-striped" as |t|>
        <t.head>
          <td class="is-one-quarter">Name</td>
          <td>Value</td>
        </t.head>
        <t.body as |row|>
          <tr data-test-server-tag>
            <td>{{row.model.name}}</td>
            <td>
              <CopyButton
                @inset={{true}}
                @compact={{true}}
                @clipboardText={{row.model.value}}
              />
              {{row.model.value}}
            </td>
          </tr>
        </t.body>
      </ListTable>
    </div>
  </div>
</section>
