This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/select-kit/addon/components/select-kit/single-select-header.js

24 lines
732 B
JavaScript

import { computed } from "@ember/object";
import SelectKitHeaderComponent from "select-kit/components/select-kit/select-kit-header";
import UtilsMixin from "select-kit/mixins/utils";
import layout from "select-kit/templates/components/select-kit/single-select-header";
import I18n from "I18n";
export default SelectKitHeaderComponent.extend(UtilsMixin, {
layout,
classNames: ["single-select-header"],
attributeBindings: ["role", "name"],
role: "combobox",
name: computed("selectedContent.name", function () {
if (this.selectedContent) {
return I18n.t("select_kit.filter_by", {
name: this.selectedContent.name,
});
} else {
return I18n.t("select_kit.select_to_filter");
}
}),
});