import { html, property, Seed, svg, TemplateResult } from '@nutmeg/seed';
import Autolinker, { AutolinkerConfig } from 'autolinker';
import { unsafeHTML } from 'lit-html/directives/unsafe-html';
import { Events, EVENT_NAME } from './events';
import { Status } from './status';
import { User } from './user';
export class TwitterStatus extends Seed {
@property({ type: Object }) public status!: import('twitter-d').Status;
@property({ type: Boolean }) public updateTimestamp = false;
private eventTarget = Events.target;
constructor() {
super();
}
private get _user(): User {
return this._status && this._status.user;
}
private get _status(): Status {
return this.status && new Status(this.status);
}
private get _retweet(): Status | undefined {
return this._status.retweet;
}
/** The component instance has been inserted into the DOM. */
public connectedCallback() {
super.connectedCallback();
if (this.updateTimestamp) {
this.eventTarget.addEventListener(EVENT_NAME, () => this.render());
Events.start();
}
}
/** The component instance has been removed from the DOM. */
public disconnectedCallback() {
super.disconnectedCallback()
}
/** Watch for changes to these attributes. */
public static get observedAttributes(): string[] {
return super.observedAttributes;
}
/** Rerender when the observed attributes change. */
public attributeChangedCallback(name: string, oldValue: any, newValue: any) {
super.attributeChangedCallback(name, oldValue, newValue)
}
/** Styling for the component. */
public get styles(): TemplateResult {
return html`
`;
}
/** HTML Template for the component. */
public get template(): TemplateResult {
return html`