import Component from "@glimmer/component"; import { action } from "@ember/object"; import { service } from "@ember/service"; import { eq, or } from "truth-helpers"; import DButton from "discourse/components/d-button"; import i18n from "discourse-common/helpers/i18n"; export default class AdminWatchedWord extends Component { @service dialog; get tags() { return this.args.word.replacement.replacement.split(","); } @action async deleteWord() { try { await this.args.word.destroy(); this.args.action(this.args.word); } catch (e) { this.dialog.alert( i18n("generic_error_with_reason", { error: `http: ${e.status} - ${e.body}`, }) ); } } }