discourse/app/assets/javascripts/admin/addon/helpers/disposition-icon.js
2020-12-01 15:31:26 -03:00

28 lines
621 B
JavaScript

import Helper from "@ember/component/helper";
import { iconHTML } from "discourse-common/lib/icon-library";
export default Helper.extend({
compute([disposition]) {
if (!disposition) {
return null;
}
let icon;
let title = "admin.flags.dispositions." + disposition;
switch (disposition) {
case "deferred": {
icon = "external-link-alt";
break;
}
case "agreed": {
icon = "thumbs-o-up";
break;
}
case "disagreed": {
icon = "thumbs-o-down";
break;
}
}
return iconHTML(icon, { title }).htmlSafe();
},
});