mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 04:18:23 +00:00
Followup to 7d8974d02f7360b324b446868463e950fe92883f Co-authored-by: David Taylor <david@taylorhq.com>
29 lines
687 B
JavaScript
29 lines
687 B
JavaScript
import Helper from "@ember/component/helper";
|
|
import { htmlSafe } from "@ember/template";
|
|
import { iconHTML } from "discourse-common/lib/icon-library";
|
|
|
|
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 = "up-right-from-square";
|
|
break;
|
|
}
|
|
case "agreed": {
|
|
icon = "thumbs-o-up";
|
|
break;
|
|
}
|
|
case "disagreed": {
|
|
icon = "thumbs-o-down";
|
|
break;
|
|
}
|
|
}
|
|
return htmlSafe(iconHTML(icon, { title }));
|
|
}
|
|
}
|