import {LitElement, html} from './lit-all.min.js'; import * as tfrpc from '/static/tfrpc.js'; import {styles} from './tf-styles.js'; class TfUserElement extends LitElement { static get properties() { return { id: {type: String}, users: {type: Object}, } } static styles = styles; constructor() { super(); this.id = null; this.users = {}; } render() { if (this.users[this.id]) { let image = this.users[this.id].image; image = typeof(image) == 'string' ? image : image?.link; return html`
${this.users[this.id].name}
`; } else { return html`
${this.id}
`; } } } customElements.define('tf-user', TfUserElement);