open-vault/ui/app/templates/components/hover-copy-button.hbs

19 lines
726 B
Handlebars
Raw Normal View History

<div class={{if this.alwaysShow "hover-copy-button-static" "hover-copy-button"}} data-test-hover-copy>
<ToolTip @onClose={{action (mut this.tooltipText) "Copy"}} as |T|>
<T.Trigger data-test-tooltip-trigger tabindex="-1">
<CopyButton
data-test-hover-copy-button
class="copy-button button is-compact is-transparent"
@clipboardText={{this.copyValue}}
@success={{action (mut this.tooltipText) "Copied!"}}
>
<Icon @name="clipboard-copy" aria-label="Copy" />
</CopyButton>
</T.Trigger>
<T.Content @defaultClass="tool-tip">
<div class="box" data-test-hover-copy-tooltip-text>
{{this.tooltipText}}
</div>
</T.Content>
</ToolTip>
</div>