open-nomad/ui/app/templates/components/copy-button.hbs
Phil Renaud 99185e2d8f
[ui, compliance] Remove the newline after .hbs copyright headers (#16861)
* Remove the newline after .hbs copyright headers

* Trying with the whitespace control char
2023-04-14 13:08:13 -04:00

39 lines
1.2 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
~}}
{{#if (eq this.state 'success')}}
<div class='button is-small is-static {{if @compact "is-compact"}} {{unless @border "is-borderless"}}'>
{{#if @inset}}
<span aria-label="Copied!">{{x-icon 'copy-success'}}</span>
{{else}}
<span class="tooltip text-center always-active" role="tooltip" aria-label="Copied!">
{{x-icon 'copy-success'}}
</span>
{{/if}}
{{yield}}
</div>
{{else if (eq this.state 'error')}}
<div class='button is-small is-static {{if @compact "is-compact"}} {{unless @border "is-borderless"}}'>
{{#if @inset}}
<span aria-label="Error copying">{{x-icon 'alert-triangle'}}</span>
{{else}}
<span class="tooltip text-center" role="tooltip" aria-label="Error copying">
{{x-icon 'alert-triangle'}}
</span>
{{/if}}
{{yield}}
</div>
{{else}}
<AddonCopyButton
@class="button is-small {{if @compact "is-compact"}} {{unless @border "is-borderless"}} {{if @inset "is-inset"}}"
@clipboardText={{this.clipboardText}}
@success={{perform this.indicateSuccess}}
@error={{action (mut this.state) "error"}}
@title="Copy"
>
{{x-icon 'copy-action'}}
{{yield}}
</AddonCopyButton>
{{/if}}