mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 18:01:36 +03:00
ea93ff2a48
no issue - relocated screen-specific components into a separate `posts-list/` directory as part of the move to keep the top-level `components/` directory for re-usable components
37 lines
857 B
JavaScript
37 lines
857 B
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {formatPostTime} from 'ghost-admin/helpers/gh-format-post-time';
|
|
import {inject as service} from '@ember/service';
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
export default class PostsListItem extends Component {
|
|
@service feature;
|
|
@service session;
|
|
@service settings;
|
|
|
|
@tracked isHovered = false;
|
|
|
|
get scheduledText() {
|
|
let {post} = this.args;
|
|
let text = [];
|
|
|
|
let formattedTime = formatPostTime(
|
|
post.publishedAtUTC,
|
|
{timezone: this.settings.get('timezone'), scheduled: true}
|
|
);
|
|
text.push(formattedTime);
|
|
|
|
return text.join(' ');
|
|
}
|
|
|
|
@action
|
|
mouseOver() {
|
|
this.isHovered = true;
|
|
}
|
|
|
|
@action
|
|
mouseLeave() {
|
|
this.isHovered = false;
|
|
}
|
|
}
|