open-vault/ui/app/components/toolbar-secret-link.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
709 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Component from '@glimmer/component';
/**
* @module ToolbarSecretLink
* `ToolbarSecretLink` styles SecretLink for the Toolbar.
* It should only be used inside of `Toolbar`.
*
* @example
* ```js
* <Toolbar>
* <ToolbarActions>
* <ToolbarSecretLink @params={{array 'vault.cluster.policies.create'}} @type="add">
* Create policy
* </ToolbarSecretLink>
* </ToolbarActions>
* </Toolbar>
* ```
*
* @param type="" {String} - Use "add" to change icon
*/
export default class ToolbarSecretLink extends Component {
get glyph() {
return this.args.type === 'add' ? 'plus' : 'chevron-right';
}
}