discourse/app/assets/javascripts/select-kit/addon/components/topic-notifications-options.js
David Taylor d1cc60c435
DEV: Convert select-kit components to native class syntax (#28489)
Changes made using the ember-native-class-codemod, plus some manual tweaks
2024-08-23 12:17:07 +01:00

25 lines
793 B
JavaScript

import { computed } from "@ember/object";
import { classNames } from "@ember-decorators/component";
import { topicLevels } from "discourse/lib/notification-levels";
import NotificationsButtonComponent from "select-kit/components/notifications-button";
import {
pluginApiIdentifiers,
selectKitOptions,
} from "select-kit/components/select-kit";
@classNames("topic-notifications-options")
@selectKitOptions({
i18nPrefix: "topic.notifications",
i18nPostfix: "i18nPostfix",
showCaret: true,
})
@pluginApiIdentifiers("topic-notifications-options")
export default class TopicNotificationsOptions extends NotificationsButtonComponent {
content = topicLevels;
@computed("topic.archetype")
get i18nPostfix() {
return this.topic.archetype === "private_message" ? "_pm" : "";
}
}