Files
frontend/src/components/ha-tip.ts
Wendelin 830d8d2410 Add type import check to eslint (#22488)
* Add type import check to eslint

* Add type imports with eslint --fix
2024-10-30 11:12:30 +00:00

51 lines
1.0 KiB
TypeScript

import { mdiLightbulbOutline } from "@mdi/js";
import { css, html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import type { HomeAssistant } from "../types";
import "./ha-svg-icon";
@customElement("ha-tip")
class HaTip extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
public render() {
if (!this.hass) {
return nothing;
}
return html`
<ha-svg-icon .path=${mdiLightbulbOutline}></ha-svg-icon>
<span class="prefix"
>${this.hass.localize("ui.panel.config.tips.tip")}</span
>
<span class="text"><slot></slot></span>
`;
}
static styles = css`
:host {
display: block;
text-align: center;
}
.text {
direction: var(--direction);
margin-left: 2px;
margin-inline-start: 2px;
margin-inline-end: initial;
color: var(--secondary-text-color);
}
.prefix {
font-weight: 500;
}
`;
}
declare global {
interface HTMLElementTagNameMap {
"ha-tip": HaTip;
}
}