mirror of
https://github.com/discourse/discourse.git
synced 2025-02-05 04:52:00 +08:00
18 lines
541 B
JavaScript
18 lines
541 B
JavaScript
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
|
import { iconHTML } from 'discourse-common/lib/icon-library';
|
|
|
|
export default Ember.Component.extend(bufferedRender({
|
|
classNameBindings: [':tip', 'good', 'bad'],
|
|
rerenderTriggers: ['validation'],
|
|
|
|
bad: Em.computed.alias('validation.failed'),
|
|
good: Em.computed.not('bad'),
|
|
|
|
buildBuffer(buffer) {
|
|
const reason = this.get('validation.reason');
|
|
if (reason) {
|
|
buffer.push(iconHTML(this.get('good') ? 'check' : 'times') + ' ' + reason);
|
|
}
|
|
}
|
|
}));
|