discourse/app/assets/javascripts/admin/helpers/disposition-icon.js

Failed to ignore revisions in .git-blame-ignore-revs.

28 lines
620 B
JavaScript
Raw Normal View History

2018-06-15 11:03:24 -04:00
import { iconHTML } from "discourse-common/lib/icon-library";
import Helper from "@ember/component/helper";
2017-09-11 16:44:20 -04:00
export default Helper.extend({
2017-09-11 16:44:20 -04:00
compute([disposition]) {
2018-06-15 11:03:24 -04:00
if (!disposition) {
return null;
}
2017-09-11 16:44:20 -04:00
let icon;
2018-06-15 11:03:24 -04:00
let title = "admin.flags.dispositions." + disposition;
2017-09-11 16:44:20 -04:00
switch (disposition) {
2018-06-15 11:03:24 -04:00
case "deferred": {
2019-01-22 14:42:00 -05:00
icon = "external-link-alt";
2018-06-15 11:03:24 -04:00
break;
}
case "agreed": {
icon = "thumbs-o-up";
break;
}
case "disagreed": {
icon = "thumbs-o-down";
break;
}
2017-09-11 16:44:20 -04:00
}
return iconHTML(icon, { title }).htmlSafe();
}
});