mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-11-03 20:17:59 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			963 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			963 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import Component from '@ember/component';
 | 
						|
import { computed } from '@ember/object';
 | 
						|
import { messageTypes } from 'core/helpers/message-types';
 | 
						|
import layout from '../templates/components/alert-banner';
 | 
						|
 | 
						|
/**
 | 
						|
 * @module AlertBanner
 | 
						|
 * `AlertBanner` components are used to inform users of important messages.
 | 
						|
 *
 | 
						|
 * @example
 | 
						|
 * ```js
 | 
						|
 * <AlertBanner @type="danger" @message="{{model.keyId}} is not a valid lease ID"/>
 | 
						|
 * ```
 | 
						|
 *
 | 
						|
 * @param type=null {String} - The banner type. This comes from the message-types helper.
 | 
						|
 * @param [message=null {String}] - The message to display within the banner.
 | 
						|
 *
 | 
						|
 */
 | 
						|
 | 
						|
export default Component.extend({
 | 
						|
  layout,
 | 
						|
  type: null,
 | 
						|
  message: null,
 | 
						|
  yieldWithoutColumn: false,
 | 
						|
  classNameBindings: ['containerClass'],
 | 
						|
 | 
						|
  containerClass: computed('type', function() {
 | 
						|
    return 'message ' + messageTypes([this.get('type')]).class;
 | 
						|
  }),
 | 
						|
 | 
						|
  alertType: computed('type', function() {
 | 
						|
    return messageTypes([this.get('type')]);
 | 
						|
  }),
 | 
						|
});
 |