0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-27 11:20:28 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/wizard-message.js.es6
Angus McLeod cf50a7deb3
Apply prettier 💄 (#80)
* Apply prettier

* applied prettier for similar-topics-validator

Co-authored-by: Faizaan Gagan <fzngagan@gmail.com>
2021-03-28 14:36:49 +05:30

32 Zeilen
890 B
JavaScript

import { default as discourseComputed } from "discourse-common/utils/decorators";
import { not, notEmpty } from "@ember/object/computed";
import Component from "@ember/component";
import I18n from "I18n";
const icons = {
error: "times-circle",
success: "check-circle",
info: "info-circle",
};
export default Component.extend({
classNameBindings: [":wizard-message", "type", "loading"],
showDocumentation: not("loading"),
showIcon: not("loading"),
hasItems: notEmpty("items"),
@discourseComputed("type")
icon(type) {
return icons[type] || "info-circle";
},
@discourseComputed("key", "component", "opts")
message(key, component, opts) {
return I18n.t(`admin.wizard.message.${component}.${key}`, opts || {});
},
@discourseComputed("component")
documentation(component) {
return I18n.t(`admin.wizard.message.${component}.documentation`);
},
});