discourse/app/assets/javascripts/admin/addon/helpers/disposition-icon.js
David Taylor 48193767bf DEV: Sort imports
Automatically generated by `eslint --fix` to satisfy the updated configuration
2023-10-10 21:46:54 +01:00

29 lines
684 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 = "external-link-alt";
break;
}
case "agreed": {
icon = "thumbs-o-up";
break;
}
case "disagreed": {
icon = "thumbs-o-down";
break;
}
}
return htmlSafe(iconHTML(icon, { title }));
}
}