2020-07-22 11:06:34 -05:00
|
|
|
import Component from "@ember/component";
|
2024-11-29 15:42:50 +00:00
|
|
|
import { action } from "@ember/object";
|
|
|
|
|
import { tagName } from "@ember-decorators/component";
|
2020-07-22 11:06:34 -05:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
|
|
|
|
|
|
|
|
const RECURRING = "recurring";
|
|
|
|
|
|
2024-11-29 15:42:50 +00:00
|
|
|
@tagName("")
|
|
|
|
|
export default class PaymentPlan extends Component {
|
2020-07-22 11:06:34 -05:00
|
|
|
@discourseComputed("selectedPlan")
|
2022-09-14 18:32:22 -04:00
|
|
|
selectedClass(planId) {
|
|
|
|
|
return planId === this.plan.id ? "btn-primary" : "";
|
2024-11-29 15:42:50 +00:00
|
|
|
}
|
2020-07-22 11:06:34 -05:00
|
|
|
|
|
|
|
|
@discourseComputed("plan.type")
|
|
|
|
|
recurringPlan(type) {
|
|
|
|
|
return type === RECURRING;
|
2024-11-29 15:42:50 +00:00
|
|
|
}
|
2020-07-22 11:06:34 -05:00
|
|
|
|
2024-11-29 15:42:50 +00:00
|
|
|
@action
|
|
|
|
|
planClick() {
|
|
|
|
|
this.clickPlan(this.plan);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|