2023-09-23 19:30:11 +02:00
|
|
|
import { inject as service } from "@ember/service";
|
|
|
|
import { action, computed } from "@ember/object";
|
|
|
|
import I18n from "I18n";
|
2023-09-24 12:58:20 +02:00
|
|
|
import Component from "@glimmer/component";
|
2023-09-23 19:30:11 +02:00
|
|
|
|
|
|
|
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
|
|
|
}
|
2023-09-23 19:30:11 +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
|
|
|
}
|
2023-09-23 19:30:11 +02:00
|
|
|
|
|
|
|
@computed("i18nKey")
|
|
|
|
get title() {
|
|
|
|
return I18n.t(`${this.i18nKey}.title`);
|
2023-09-24 12:58:20 +02:00
|
|
|
}
|
2023-09-23 19:30:11 +02:00
|
|
|
|
|
|
|
@computed("i18nKey")
|
|
|
|
get label() {
|
|
|
|
return I18n.t(`${this.i18nKey}.label`);
|
2023-09-24 12:58:20 +02:00
|
|
|
}
|
2023-09-23 19:30:11 +02:00
|
|
|
|
|
|
|
@action
|
|
|
|
click() {
|
|
|
|
window.open(this.subscription.subscriptionCtaLink, "_blank").focus();
|
2023-09-24 12:58:20 +02:00
|
|
|
}
|
|
|
|
}
|