diff --git a/src/dialogs/more-info/ha-more-info-dialog.ts b/src/dialogs/more-info/ha-more-info-dialog.ts index 04ebaeebf2..0e04e19024 100644 --- a/src/dialogs/more-info/ha-more-info-dialog.ts +++ b/src/dialogs/more-info/ha-more-info-dialog.ts @@ -8,7 +8,7 @@ import { mdiPencilOutline, } from "@mdi/js"; import type { HassEntity } from "home-assistant-js-websocket"; -import { css, html, LitElement, PropertyValues } from "lit"; +import { css, html, LitElement, nothing, PropertyValues } from "lit"; import { customElement, property, state } from "lit/decorators"; import { cache } from "lit/directives/cache"; import { dynamicElement } from "../../common/dom/dynamic-element-directive"; @@ -211,7 +211,7 @@ export class MoreInfoDialog extends LitElement { protected render() { if (!this._entityId) { - return null; + return nothing; } const entityId = this._entityId; const stateObj = this.hass.states[entityId] as HassEntity | undefined; @@ -261,7 +261,7 @@ export class MoreInfoDialog extends LitElement { > ${title} ` - : null} + : nothing} ${isInfoView ? html` ${this.shouldShowHistory(domain) @@ -275,77 +275,79 @@ export class MoreInfoDialog extends LitElement { @click=${this._goToHistory} > ` - : null} - + : nothing} ${isAdmin - ? html` + ? html` - - ${deviceId - ? html` - - ${this.hass.localize( - "ui.dialogs.more_info_control.device_info" - )} - - - ` - : null} - ${this.shouldShowEditIcon(domain, stateObj) - ? html` - - ${this.hass.localize( - "ui.dialogs.more_info_control.edit" - )} - - - ` - : null} - - ${this.hass.localize( - "ui.dialogs.more_info_control.related" + slot="actionItems" + .label=${this.hass.localize( + "ui.dialogs.more_info_control.settings" )} - - - ` - : null} + .path=${mdiCogOutline} + @click=${this._goToSettings} + > + + + + ${deviceId + ? html` + + ${this.hass.localize( + "ui.dialogs.more_info_control.device_info" + )} + + + ` + : nothing} + ${this.shouldShowEditIcon(domain, stateObj) + ? html` + + ${this.hass.localize( + "ui.dialogs.more_info_control.edit" + )} + + + ` + : nothing} + + ${this.hass.localize( + "ui.dialogs.more_info_control.related" + )} + + + + ` + : nothing} ` - : null} + : nothing}
` - : null + : nothing )}