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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
687 B
JavaScript
Raw Normal View History

import Helper from "@ember/component/helper";
import { htmlSafe } from "@ember/template";
import { iconHTML } from "discourse-common/lib/icon-library";
2017-09-12 04:44:20 +08:00
export default class DispositionIcon extends Helper {
2017-09-12 04:44:20 +08:00
compute([disposition]) {
if (!disposition) {
return null;
}
let icon;
let title = "admin.flags.dispositions." + disposition;
switch (disposition) {
case "deferred": {
icon = "up-right-from-square";
2017-09-12 04:44:20 +08:00
break;
}
case "agreed": {
icon = "thumbs-o-up";
break;
}
case "disagreed": {
icon = "thumbs-o-down";
break;
}
}
return htmlSafe(iconHTML(icon, { title }));
}
}