import type { TemplateResult } from "lit"; import { css, html, LitElement } from "lit"; import { customElement, property } from "lit/decorators"; import type { HaFormConstantSchema, HaFormElement } from "./types"; @customElement("ha-form-constant") export class HaFormConstant extends LitElement implements HaFormElement { @property({ attribute: false }) public schema!: HaFormConstantSchema; @property() public label!: string; protected render(): TemplateResult { return html`${this.label}${this.schema.value ? `: ${this.schema.value}` : ""}`; } static styles = css` :host { display: block; } .label { font-weight: 500; } `; } declare global { interface HTMLElementTagNameMap { "ha-form-constant": HaFormConstant; } }