open-vault/ui/app/components/edition-badge.js

19 lines
504 B
JavaScript
Raw Normal View History

import { computed } from '@ember/object';
import Component from '@ember/component';
2018-04-03 14:16:57 +00:00
export default Component.extend({
2018-04-03 14:16:57 +00:00
tagName: 'span',
2018-08-15 19:41:43 +00:00
classNames: 'tag is-outlined edition-badge',
attributeBindings: ['edition:aria-label'],
icon: computed('edition', function() {
2018-04-03 14:16:57 +00:00
const edition = this.get('edition');
2018-08-15 19:41:43 +00:00
const entEditions = ['Enterprise', 'Premium', 'Pro'];
2018-08-16 16:42:11 +00:00
if (entEditions.includes(edition)) {
2018-08-15 19:41:43 +00:00
return 'edition-enterprise';
2018-04-03 14:16:57 +00:00
} else {
2018-08-15 19:41:43 +00:00
return 'edition-oss';
2018-04-03 14:16:57 +00:00
}
}),
});