Ghost/ghost/admin/app/components/gh-members-list-item.js
2019-10-02 17:05:57 +05:30

28 lines
860 B
JavaScript

import Component from '@ember/component';
import moment from 'moment';
import {alias} from '@ember/object/computed';
import {computed} from '@ember/object';
import {inject as service} from '@ember/service';
export default Component.extend({
ghostPaths: service(),
notifications: service(),
router: service(),
tagName: 'li',
classNames: ['gh-list-row', 'gh-tags-list-item'],
active: false,
id: alias('member.id'),
email: alias('member.email'),
name: computed('member.name', function () {
return this.member.name || '-';
}),
subscribedAt: computed('member.createdAt', function () {
let memberSince = moment(this.member.createdAt).from(moment());
let createdDate = moment(this.member.createdAt).format('MMM DD, YYYY');
return `Created on ${createdDate} (${memberSince})`;
})
});