diff --git a/src/layouts/hass-tabs-subpage-data-table.ts b/src/layouts/hass-tabs-subpage-data-table.ts
index f891f6b1f9..7d3e90d623 100644
--- a/src/layouts/hass-tabs-subpage-data-table.ts
+++ b/src/layouts/hass-tabs-subpage-data-table.ts
@@ -124,6 +124,12 @@ export class HaTabsSubpageDataTable extends LitElement {
*/
@property({ type: String }) public noDataText?: string;
+ /**
+ * Hides the data table and show an empty message.
+ * @type {Boolean}
+ */
+ @property({ type: Boolean }) public empty = false;
+
@property() public route!: Route;
/**
@@ -198,56 +204,61 @@ export class HaTabsSubpageDataTable extends LitElement {
.mainPage=${this.mainPage}
.supervisor=${this.supervisor}
>
- ${!this.hideFilterMenu
- ? html`
-
- ${this.narrow
+ ${this.empty
+ ? html`
+ ${this.noDataText}
+
`
+ : html`${!this.hideFilterMenu
+ ? html`
+
+ ${this.narrow
+ ? html`
+
+ `
+ : ""}
+
+ `
+ : ""}
+ ${this.narrow
+ ? html`
+
+ `
+ : ""}
+
+ ${!this.narrow
? html`
-
- `
- : ""}
- ${this.narrow
- ? html`
-
- `
- : ""}
-
- ${!this.narrow
- ? html`
-
-
-
-
-
- `
- : html` `}
-
+ : html` `}
+ `}
+
`;
@@ -374,6 +385,16 @@ export class HaTabsSubpageDataTable extends LitElement {
.filter-menu {
position: relative;
}
+ .center {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+ box-sizing: border-box;
+ height: 100%;
+ width: 100%;
+ padding: 16px;
+ }
`;
}
}
diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts
index 2e0c917086..acde418b3f 100644
--- a/src/panels/config/automation/ha-automation-picker.ts
+++ b/src/panels/config/automation/ha-automation-picker.ts
@@ -7,11 +7,19 @@ import {
mdiPlay,
mdiPlayCircleOutline,
mdiPlus,
+ mdiRobotHappy,
mdiStopCircleOutline,
mdiTransitConnection,
} from "@mdi/js";
import "@lrnwebcomponents/simple-tooltip/simple-tooltip";
-import { CSSResultGroup, html, LitElement, TemplateResult } from "lit";
+import {
+ css,
+ CSSResultGroup,
+ html,
+ LitElement,
+ nothing,
+ TemplateResult,
+} from "lit";
import { customElement, property, state } from "lit/decorators";
import memoizeOne from "memoize-one";
import { differenceInDays } from "date-fns/esm";
@@ -295,6 +303,7 @@ class HaAutomationPicker extends LitElement {
.activeFilters=${this._activeFilters}
.columns=${this._columns(this.narrow, this.hass.locale)}
.data=${this._automations(this.automations, this._filteredAutomations)}
+ .empty=${!this.automations.length}
@row-click=${this._handleRowClicked}
.noDataText=${this.hass.localize(
"ui.panel.config.automation.picker.no_automations"
@@ -318,6 +327,35 @@ class HaAutomationPicker extends LitElement {
@related-changed=${this._relatedFilterChanged}
>
+ ${!this.automations.length
+ ? html`
`
+ : nothing}
+ ${!this.scenes.length
+ ? html` `
+ : nothing}
+ ${!this.scripts.length
+ ? html` `
+ : nothing}