2021-08-10 15:11:22 +03:00
|
|
|
import Component from '@glimmer/component';
|
2022-03-04 19:32:32 +03:00
|
|
|
import {get} from '@ember/object';
|
|
|
|
import {mostRecentlyUpdated} from 'ghost-admin/helpers/most-recently-updated';
|
2021-08-10 15:11:22 +03:00
|
|
|
|
2022-10-07 19:09:18 +03:00
|
|
|
export default class MembersListItemColumn extends Component {
|
2021-08-10 15:11:22 +03:00
|
|
|
constructor(...args) {
|
|
|
|
super(...args);
|
|
|
|
}
|
|
|
|
|
|
|
|
get labels() {
|
2022-03-04 19:32:32 +03:00
|
|
|
const labelData = get(this.args.member, 'labels') || [];
|
2021-08-13 16:17:07 +03:00
|
|
|
return labelData.map(label => label.name).join(', ');
|
2021-08-10 15:11:22 +03:00
|
|
|
}
|
2021-08-16 12:13:23 +03:00
|
|
|
|
2022-05-11 20:11:54 +03:00
|
|
|
get tiers() {
|
|
|
|
const tierData = get(this.args.member, 'tiers') || [];
|
|
|
|
return tierData.map(tier => tier.name).join(', ');
|
2022-02-28 13:38:44 +03:00
|
|
|
}
|
|
|
|
|
2022-03-04 19:32:32 +03:00
|
|
|
get mostRecentSubscription() {
|
|
|
|
return mostRecentlyUpdated(get(this.args.member, 'subscriptions'));
|
2021-08-16 12:13:23 +03:00
|
|
|
}
|
2021-08-10 15:11:22 +03:00
|
|
|
}
|