2019-11-06 02:43:49 +08:00
|
|
|
import Helper from "@ember/component/helper";
|
2022-05-14 03:58:26 +08:00
|
|
|
import { htmlSafe } from "@ember/template";
|
2023-10-11 02:38:59 +08:00
|
|
|
import { iconHTML } from "discourse-common/lib/icon-library";
|
2017-09-12 04:44:20 +08:00
|
|
|
|
2023-03-17 20:25:05 +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": {
|
2024-09-13 23:50:52 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2022-05-14 03:58:26 +08:00
|
|
|
return htmlSafe(iconHTML(icon, { title }));
|
2023-03-17 20:25:05 +08:00
|
|
|
}
|
|
|
|
}
|