import { state, property } from "lit/decorators.js"; import { msg, localized } from "@lit/localize"; import type { AuthState } from "../utils/AuthService"; import type { CurrentUser } from "../types/user"; import type { ArchiveData } from "../utils/archives"; import LiteElement, { html } from "../utils/LiteElement"; @localized() export class Home extends LiteElement { @property({ type: Object }) authState?: AuthState; @property({ type: Object }) userInfo?: CurrentUser; @state() private isInviteComplete?: boolean; @state() private archiveList?: ArchiveData[]; async firstUpdated() { this.archiveList = await this.getArchives(); } connectedCallback() { if (this.authState) { super.connectedCallback(); } else { this.navTo("/log-in"); } } render() { if (!this.userInfo || !this.archiveList) { return html`
${msg("Invite users to start archiving.")}
${this.renderInvite()}${msg("You don't have any archives.")}