1{{#if (eq display 'menu')}}
2  <div class="level is-mobile">
3    <div class="level-left is-flex-1">
4      {{#if replicationUnsupported}}
5        Unsupported
6      {{else if replicationEnabled}}
7        <span>
8          {{capitalize modeForUrl}}
9        </span>
10        {{#if secondaryId}}
11          <small>
12            <code>
13              {{secondaryId}}
14            </code>
15          </small>
16        {{/if}}
17        <small>
18          <code>
19            {{clusterIdDisplay}}
20          </code>
21        </small>
22        {{else if (and (eq mode 'performance') (not (has-feature "Performance Replication")))}}
23        Learn more
24      {{else if auth.currentToken}}
25        Enable {{if (eq mode 'performance') 'Performance' 'DR'}}
26      {{else}}
27        Not enabled
28      {{/if}}
29    </div>
30    <div class="level-right">
31      {{#if replicationEnabled}}
32        {{#if (get cluster (concat mode 'StateGlyph'))}}
33          <span class="has-text-success">
34            <Icon
35              aria-hidden="true"
36              @glyph={{get cluster (concat mode 'StateGlyph')}}
37            />
38          </span>
39        {{else if syncProgress}}
40          <progress value="{{syncProgressPercent}}" max="100" class="progress is-small is-narrow is-info">
41            {{syncProgress.progress}} of {{syncProgress.total}} keys
42          </progress>
43        {{/if}}
44      {{else}}
45        <Icon
46          aria-label="Replication not enabled"
47          @glyph="minus-circle-outline"
48          class="has-text-grey-light"
49        />
50      {{/if}}
51    </div>
52  </div>
53{{else}}
54  <div class="level-left is-flex-1">
55    <div>
56      {{#if (and (eq mode 'performance') (not (has-feature "Performance Replication")))}}
57        <p>
58          Performance Replication is a feature of Vault Enterprise Premium.
59        </p>
60        <p class="has-text-centered">
61          <a
62            href="https://hashicorp.com/products/vault/trial?source=vaultui_Performance%20Replication"
63            class="button is-ghost has-icon-right"
64            data-test-upgrade-link="true"
65          >
66            Learn more
67            <Chevron />
68          </a>
69        </p>
70      {{else if replicationEnabled}}
71        <h5 class="title is-7 is-uppercase is-marginless">
72          Enabled
73        </h5>
74        <span class="has-text-grey">
75          {{capitalize modeForUrl}}
76        </span>
77        {{#if secondaryId}}
78          <span class="tag">
79            <code>
80              {{secondaryId}}
81            </code>
82          </span>
83        {{/if}}
84        <span class="tag">
85          <code>
86            {{clusterIdDisplay}}
87          </code>
88        </span>
89      {{else}}
90        <p class="help has-text-grey-dark">
91          {{#if (eq mode 'dr')}}
92            DR is designed to protect against catastrophic failure of entire clusters. Secondaries do not forward service requests (until they are elected and become a new primary).
93          {{else}}
94            Performance Replication scales workloads horizontally across clusters to make requests faster. Local secondaries handle read requests but forward writes to the primary to be handled.
95          {{/if}}
96        </p>
97      {{/if}}
98    </div>
99  </div>
100  <div class="level-right">
101    {{#if replicationDisabled}}
102      {{#link-to "vault.cluster.replication.mode.index" cluster.name mode class="button is-primary"}}
103        Enable
104      {{/link-to}}
105    {{else if (eq mode 'dr')}}
106      {{cluster.drReplicationStateDisplay}}
107    {{else if (eq mode 'performance')}}
108      {{cluster.perfReplicationStateDisplay}}
109    {{/if}}
110  </div>
111{{/if}}
112