2019-11-05 13:43:49 -05:00
|
|
|
import Helper from "@ember/component/helper";
|
2017-09-11 16:44:20 -04:00
|
|
|
import { iconHTML } from "discourse-common/lib/icon-library";
|
2022-05-13 15:58:26 -04:00
|
|
|
import { htmlSafe } from "@ember/template";
|
2017-09-11 16:44:20 -04:00
|
|
|
|
2023-03-17 08:25:05 -04:00
|
|
|
export default class DispositionIcon extends Helper {
|
2017-09-11 16:44:20 -04:00
|
|
|
compute([disposition]) {
|
|
|
|
if (!disposition) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
let icon;
|
|
|
|
let title = "admin.flags.dispositions." + disposition;
|
|
|
|
switch (disposition) {
|
|
|
|
case "deferred": {
|
2019-01-22 14:42:00 -05:00
|
|
|
icon = "external-link-alt";
|
2017-09-11 16:44:20 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case "agreed": {
|
|
|
|
icon = "thumbs-o-up";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case "disagreed": {
|
|
|
|
icon = "thumbs-o-down";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2022-05-13 15:58:26 -04:00
|
|
|
return htmlSafe(iconHTML(icon, { title }));
|
2023-03-17 08:25:05 -04:00
|
|
|
}
|
|
|
|
}
|