import { customElement, html, LitElement, property, TemplateResult } from "lit-element";
import { Source, SourcesApi } from "authentik-api";
import { DEFAULT_CONFIG } from "../../api/Config";
import "../../elements/buttons/SpinnerButton";
import "../../elements/EmptyState";
import "../../elements/PageHeader";
import "./ldap/LDAPSourceViewPage";
import "./oauth/OAuthSourceViewPage";
import "./saml/SAMLSourceViewPage";
import { ifDefined } from "lit-html/directives/if-defined";
@customElement("ak-source-view")
export class SourceViewPage extends LitElement {
@property({ type: String })
set sourceSlug(slug: string) {
new SourcesApi(DEFAULT_CONFIG).sourcesAllRead({
slug: slug
}).then((source) => {
this.source = source;
});
}
@property({ attribute: false })
source?: Source;
renderSource(): TemplateResult {
if (!this.source) {
return html`
Invalid source type ${this.source.component}
`; } } render(): TemplateResult { return html`