import { html } from 'lit-html'; import { customElement, instance } from '@lit-html-free/core'; import { SharedState } from 'src/resources/state/sharedstate'; import { href } from '@lit-html-free/router'; function format(date: Date) { return new Date(date).toLocaleDateString('en', { month: 'long', day: '2-digit', year: 'numeric' }); } @customElement('comment-section') export default class extends HTMLElement { public comment: any; public sharedState: any; public deleteCb: Function; get canModify() { return ( this.sharedState.currentUser && this.comment.author.username === this.sharedState.currentUser.username ); } constructor() { super(); this.sharedState = instance(SharedState); } public render() { return html`

${this.comment.body}

`; } }