This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/web/src/elements/EmptyState.ts
Jens Langhammer e06d729fe5 web: SpinnerSize -> PFSize, add size prop for modal button
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
2021-04-04 22:04:46 +02:00

50 lines
1.6 KiB
TypeScript

import { CSSResult, customElement, html, LitElement, property, TemplateResult } from "lit-element";
import PFEmptyState from "@patternfly/patternfly/components/EmptyState/empty-state.css";
import PFBase from "@patternfly/patternfly/patternfly-base.css";
import PFTitle from "@patternfly/patternfly/components/Title/title.css";
import AKGlobal from "../authentik.css";
import { PFSize } from "./Spinner";
@customElement("ak-empty-state")
export class EmptyState extends LitElement {
@property({type: String})
icon = "";
@property({type: Boolean})
loading = false;
@property({type: Boolean})
fullHeight = false;
@property()
header = "";
static get styles(): CSSResult[] {
return [PFBase, PFEmptyState, PFTitle, AKGlobal];
}
render(): TemplateResult {
return html`<div class="pf-c-empty-state ${this.fullHeight && "pf-m-full-height"}">
<div class="pf-c-empty-state__content">
${this.loading ?
html`<div class="pf-c-empty-state__icon">
<ak-spinner size=${PFSize.XLarge}></ak-spinner>
</div>`:
html`<i class="pf-icon fa ${this.icon || "fa-question-circle"} pf-c-empty-state__icon" aria-hidden="true"></i>`}
<h1 class="pf-c-title pf-m-lg">
${this.header}
</h1>
<div class="pf-c-empty-state__body">
<slot name="body"></slot>
</div>
<div class="pf-c-empty-state__primary">
<slot name="primary"></slot>
</div>
</div>
</div>`;
}
}