2021-08-23 04:44:19 -04:00
|
|
|
import Component from "@ember/component";
|
|
|
|
import { computed } from "@ember/object";
|
|
|
|
import layout from "select-kit/templates/components/multi-select/format-selected-content";
|
|
|
|
import { makeArray } from "discourse-common/lib/helpers";
|
|
|
|
import UtilsMixin from "select-kit/mixins/utils";
|
|
|
|
|
|
|
|
export default Component.extend(UtilsMixin, {
|
|
|
|
tagName: "",
|
|
|
|
layout,
|
|
|
|
content: null,
|
|
|
|
selectKit: null,
|
|
|
|
|
2022-06-20 14:02:05 -04:00
|
|
|
formattedContent: computed("content", function () {
|
2021-08-23 04:44:19 -04:00
|
|
|
if (this.content) {
|
|
|
|
return makeArray(this.content)
|
|
|
|
.map((c) => this.getName(c))
|
|
|
|
.join(", ");
|
|
|
|
} else {
|
|
|
|
return this.getName(this.selectKit.noneItem);
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
});
|