import Ember from 'ember'; const { Component, computed, inject: {service}, String: {htmlSafe} } = Ember; export default Component.extend({ tagName: '', user: null, ghostPaths: service(), userDefault: computed('ghostPaths', function () { return `${this.get('ghostPaths.subdir')}/ghost/img/user-image.png`; }), userImageBackground: computed('user.image', 'userDefault', function () { let url = this.get('user.image') || this.get('userDefault'); return htmlSafe(`background-image: url(${url})`); }), lastLoginUTC: computed('user.lastLoginUTC', function () { let lastLoginUTC = this.get('user.lastLoginUTC'); return lastLoginUTC ? moment(lastLoginUTC).fromNow() : '(Never)'; }) });