2023-04-10 15:36:59 +00:00
|
|
|
{{!
|
|
|
|
Copyright (c) HashiCorp, Inc.
|
|
|
|
SPDX-License-Identifier: MPL-2.0
|
2023-04-14 17:08:13 +00:00
|
|
|
~}}
|
2023-04-10 15:36:59 +00:00
|
|
|
|
2020-07-09 20:19:07 +00:00
|
|
|
{{#if (eq this.state 'success')}}
|
2022-06-21 19:49:35 +00:00
|
|
|
<div class='button is-small is-static {{if @compact "is-compact"}} {{unless @border "is-borderless"}}'>
|
2023-03-22 19:05:01 +00:00
|
|
|
{{#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}}
|
2020-11-04 18:22:24 +00:00
|
|
|
{{yield}}
|
2019-07-15 17:14:32 +00:00
|
|
|
</div>
|
2020-07-09 20:19:07 +00:00
|
|
|
{{else if (eq this.state 'error')}}
|
2022-06-21 19:49:35 +00:00
|
|
|
<div class='button is-small is-static {{if @compact "is-compact"}} {{unless @border "is-borderless"}}'>
|
2023-03-22 19:05:01 +00:00
|
|
|
{{#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}}
|
2020-11-04 18:22:24 +00:00
|
|
|
{{yield}}
|
2019-07-15 17:14:32 +00:00
|
|
|
</div>
|
|
|
|
{{else}}
|
2020-06-01 19:03:56 +00:00
|
|
|
<AddonCopyButton
|
2023-03-22 19:05:01 +00:00
|
|
|
@class="button is-small {{if @compact "is-compact"}} {{unless @border "is-borderless"}} {{if @inset "is-inset"}}"
|
2020-07-09 20:19:07 +00:00
|
|
|
@clipboardText={{this.clipboardText}}
|
|
|
|
@success={{perform this.indicateSuccess}}
|
|
|
|
@error={{action (mut this.state) "error"}}
|
2020-07-28 17:59:14 +00:00
|
|
|
@title="Copy"
|
2020-06-01 19:03:56 +00:00
|
|
|
>
|
2019-07-15 17:14:32 +00:00
|
|
|
{{x-icon 'copy-action'}}
|
2020-11-04 18:22:24 +00:00
|
|
|
{{yield}}
|
2020-06-01 19:03:56 +00:00
|
|
|
</AddonCopyButton>
|
2019-07-15 17:14:32 +00:00
|
|
|
{{/if}}
|