0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 10:40:28 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/wizard-subscription-cta.js

35 Zeilen
812 B
JavaScript

import { inject as service } from "@ember/service";
import { action, computed } from "@ember/object";
2023-09-24 12:58:20 +02:00
import Component from "@glimmer/component";
export default class WizardSubscriptionCta extends Component {
@service subscription;
@computed("subscription.subscribed")
get i18nKey() {
return `admin.wizard.subscription.cta.${
this.subscription.subscribed ? "subscribed" : "none"
}`;
2023-09-24 12:58:20 +02:00
}
@computed("subscription.subscribed")
get icon() {
return this.subscription.subscribed ? "far-life-ring" : "external-link-alt";
2023-09-24 12:58:20 +02:00
}
@computed("i18nKey")
get title() {
2023-09-24 14:01:46 +02:00
return `${this.i18nKey}.title`;
2023-09-24 12:58:20 +02:00
}
@computed("i18nKey")
get label() {
2023-09-24 14:01:46 +02:00
return `${this.i18nKey}.label`;
2023-09-24 12:58:20 +02:00
}
@action
click() {
window.open(this.subscription.subscriptionCtaLink, "_blank").focus();
2023-09-24 12:58:20 +02:00
}
}