import { r as registerInstance, e as createEvent, B as Build, h } from './index-e0adbd54.js';
import { s as state } from './store-75674961.js';
import './index-96e8c812.js';
import './getHandlebarsHelpers-c1e27d99.js';
import './_commonjsHelpers-44457d8d.js';
import './index-e6b3332e.js';
import './localforage-394b59fa.js';

const appMaterialListCss = "";

const AppMaterial = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.fireenjinTrigger = createEvent(this, "fireenjinTrigger", 7);
    this.fireenjinSubmit = createEvent(this, "fireenjinSubmit", 7);
    this.eventIconMap = {
      alert: "notifications",
      notion: "./assets/svg/notion.svg",
    };
    this.query = undefined;
  }
  onSearchInput(event) {
    this.query = event.target.value;
  }
  componentDidLoad() {
    if (!(Build === null || Build === void 0 ? void 0 : Build.isBrowser))
      return;
    // Get Data
  }
  render() {
    var _a;
    return [
      h("ion-content", { class: "ion-padding" }, h("div", { class: "ion-padding" }, h("fireenjin-search-bar", { ref: (el) => (this.filterBarEl = el), paginationEl: this.paginationEl }), h("fireenjin-pagination", { ref: (el) => (this.paginationEl = el), name: "materials", resultsKey: "materials", disableVirtualScroll: true, removeDuplicates: true, listEl: ({ result: material }) => (h("ion-item", { href: `/materials/${material.id}`, detail: true, lines: "full" }, h("ion-grid", null, h("ion-row", { class: "ion-align-items-center ion-justify-content-between" }, h("ion-col", null, h("ion-label", null, h("h2", null, material.name))))))), display: "list", endpoint: "listMaterials", limit: 20, query: this.query }))),
      h("floodteam-navigation-footer", null, h("floodteam-title-bar", { back: "/dashboard" }, h("ion-breadcrumbs", null, h("ion-breadcrumb", { onClick: () => this.fireenjinTrigger.emit({
          name: "pin",
          payload: {
            icon: "flash",
            href: `/materials`,
            name: "Materials",
          },
        }) }, h("ion-icon", { color: ((_a = ((state === null || state === void 0 ? void 0 : state.pins) || [])
          .map((pin) => pin === null || pin === void 0 ? void 0 : pin.href)) === null || _a === void 0 ? void 0 : _a.includes(`/materials`))
          ? "primary"
          : null, slot: "start", name: "pin" }), "Materials")), h("ion-buttons", { slot: "end" }, h("ion-button", { fill: "solid", color: "primary", href: "/materials/new" }, "Add")))),
    ];
  }
};
AppMaterial.style = appMaterialListCss;

export { AppMaterial as app_material_list };
