mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 07:51:36 +08:00
74349e17c9
This commit was generated using the ember-native-class-codemod along with a handful of manual updates
29 lines
684 B
JavaScript
29 lines
684 B
JavaScript
import Helper from "@ember/component/helper";
|
|
import { iconHTML } from "discourse-common/lib/icon-library";
|
|
import { htmlSafe } from "@ember/template";
|
|
|
|
export default class DispositionIcon extends Helper {
|
|
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 htmlSafe(iconHTML(icon, { title }));
|
|
}
|
|
}
|