import { css, CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element"; import { COMMON_STYLES } from "../../common/styles"; import "../../elements/buttons/ModalButton"; import "../../elements/buttons/SpinnerButton"; import { SpinnerSize } from "../../elements/Spinner"; import "./LDAPSourceViewPage"; import "./OAuthSourceViewPage"; import { Source } from "../../api/Sources"; @customElement("ak-source-view") export class SourceViewPage extends LitElement { @property() set args(value: { [key: string]: string }) { this.sourceSlug = value.slug; } @property({ type: String }) set sourceSlug(slug: string) { Source.get(slug).then((app) => (this.source = app)); } @property({ attribute: false }) source?: Source; static get styles(): CSSResult[] { return COMMON_STYLES.concat(css` * { height: 100%; } `); } render(): TemplateResult { if (!this.source) { return html`
Invalid source type ${this.source.object_type}
`; } } }