github.com/hernad/nomad@v1.6.112/ui/app/templates/components/copy-button.hbs (about) 1 {{! 2 Copyright (c) HashiCorp, Inc. 3 SPDX-License-Identifier: MPL-2.0 4 ~}} 5 6 <div class="copy-button {{if @inset "inset"}}"> 7 {{#if (eq this.state 'success')}} 8 <div data-test-copy-success class='button is-small is-static {{if @compact "is-compact"}} {{unless @border "is-borderless"}}'> 9 {{#if @inset}} 10 <span aria-label="Copied!">{{x-icon 'copy-success'}}</span> 11 {{else}} 12 <span class="tooltip text-center always-active" role="tooltip" aria-label="Copied!"> 13 {{x-icon 'copy-success'}} 14 </span> 15 {{/if}} 16 {{yield}} 17 </div> 18 {{else if (eq this.state 'error')}} 19 <div class='button is-small is-static {{if @compact "is-compact"}} {{unless @border "is-borderless"}}'> 20 {{#if @inset}} 21 <span aria-label="Error copying">{{x-icon 'alert-triangle'}}</span> 22 {{else}} 23 <span class="tooltip text-center" role="tooltip" aria-label="Error copying"> 24 {{x-icon 'alert-triangle'}} 25 </span> 26 {{/if}} 27 {{yield}} 28 </div> 29 {{else}} 30 <AddonCopyButton 31 title="Copy" 32 class="button is-small {{if @compact "is-compact"}} {{unless @border "is-borderless"}} {{if @inset "is-inset"}}" 33 @text={{this.text}} 34 @onSuccess={{perform this.indicateSuccess}} 35 @onError={{action (mut this.state) "error"}} 36 > 37 {{x-icon 'copy-action'}} 38 {{yield}} 39 </AddonCopyButton> 40 {{/if}} 41 </div>