open-vault/ui/lib/core/addon/components/toolbar-link.js
Joshua Ogle 5c5a33f6df
UI: Add Toolbar to Storybook (#6761)
* Add Toolbar stories
* Update ConfirmAction story
2019-05-20 18:10:42 -06:00

38 lines
891 B
JavaScript

/**
* @module ToolbarLink
* `ToolbarLink` components style links and buttons for the Toolbar
* It should only be used inside of `Toolbar`.
*
* @example
* ```js
* <Toolbar>
* <ToolbarActions>
* <ToolbarLink @params={{array 'vault.cluster.policies.create'}} @type="add">
* Create policy
* </ToolbarLink>
* </ToolbarActions>
* </Toolbar>
* ```
*
* @param params=''{Array} Array to pass to LinkTo
* @param type=''{String} Use "add" to change icon
*/
import Component from '@ember/component';
import { computed } from '@ember/object';
import layout from '../templates/components/toolbar-link';
export default Component.extend({
layout,
tagName: '',
supportsDataTestProperties: true,
type: null,
glyph: computed('type', function() {
if (this.type == 'add') {
return 'plus-plain';
} else {
return 'chevron-right';
}
}),
});