import { TemplateResult, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { until } from "lit/directives/until.js"; import "../Spinner"; import { PFSize } from "../Spinner"; import { AggregateCard } from "./AggregateCard"; @customElement("ak-aggregate-card-promise") export class AggregatePromiseCard extends AggregateCard { @property({ attribute: false }) promise?: Promise>; promiseProxy(): Promise { if (!this.promise) { return new Promise(() => html``); } return this.promise.then((s) => { return html` ${s.toString()}`; }); } renderInner(): TemplateResult { return html` ${until(this.promiseProxy(), html``)} `; } }
${until(this.promiseProxy(), html``)}