open-vault/ui/app/components/hover-copy-button.js
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

30 lines
737 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
/**
* @module HoverCopyButton
* The `HoverCopyButton` is used on dark backgrounds to show a copy button.
*
* @example ```js
* <HoverCopyButton @copyValue={{stringify this.model.id}} @alwaysShow={{true}} />```
*
* @param {string} copyValue - The value to be copied.
* @param {boolean} [alwaysShow] - Boolean that affects the class.
*/
export default class HoverCopyButton extends Component {
get alwaysShow() {
return this.args.alwaysShow || false;
}
get copyValue() {
return this.args.copyValue || false;
}
@tracked tooltipText = 'Copy';
}