0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-24 10:20:28 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/wizard-message.js.es6

34 Zeilen
920 B
Text

import { default as discourseComputed } from "discourse-common/utils/decorators";
import { not, notEmpty } from "@ember/object/computed";
2020-04-20 13:40:32 +02:00
import Component from "@ember/component";
2020-05-28 05:06:06 +02:00
import I18n from "I18n";
2020-04-20 13:40:32 +02:00
const icons = {
error: "times-circle",
success: "check-circle",
warn: "exclamation-circle",
info: "info-circle",
};
2020-04-20 13:40:32 +02:00
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 || {});
2020-04-20 13:40:32 +02:00
},
@discourseComputed("component")
2020-04-20 13:40:32 +02:00
documentation(component) {
return I18n.t(`admin.wizard.message.${component}.documentation`);
},
});