mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 19:09:48 +00:00
Allow different types of heading badges (#22109)
* Allow different type of heading item * Update editor * Migrate entities to items * Rename support for string entity * Refactor * Rename to badges and add error state * Update font weight * Feedback * Feedback
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import "../heading-badges/hui-entity-heading-badge";
|
||||
|
||||
import {
|
||||
createLovelaceElement,
|
||||
getLovelaceElementClass,
|
||||
} from "./create-element-base";
|
||||
import { LovelaceHeadingBadgeConfig } from "../heading-badges/types";
|
||||
|
||||
const ALWAYS_LOADED_TYPES = new Set(["error", "entity"]);
|
||||
|
||||
export const createHeadingBadgeElement = (config: LovelaceHeadingBadgeConfig) =>
|
||||
createLovelaceElement(
|
||||
"heading-badge",
|
||||
config,
|
||||
ALWAYS_LOADED_TYPES,
|
||||
undefined,
|
||||
undefined,
|
||||
"entity"
|
||||
);
|
||||
|
||||
export const getHeadingBadgeElementClass = (type: string) =>
|
||||
getLovelaceElementClass(type, "heading-badge", ALWAYS_LOADED_TYPES);
|
||||
Reference in New Issue
Block a user