import { r as registerInstance, B as Build, h } from './index-000d2977.js';

const appLocationListCss = "";

const AppLocationList = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.filters = {};
  }
  onSearchInput(event) {
    this.query = event.target.value;
  }
  componentDidLoad() {
    if (!(Build === null || Build === void 0 ? void 0 : Build.isBrowser))
      return;
  }
  render() {
    return [
      h("ion-content", { class: "ion-padding" }, h("floodteam-title-bar", null, h("ion-router-link", { href: "/locations" }, "Locations"), h("ion-buttons", { slot: "end" }, h("ion-button", { fill: "solid", color: "primary", href: "/locations/new" }, "Add"))), h("div", { class: "ion-padding" }, h("fireenjin-search-bar", { ref: (el) => (this.filterBarEl = el), paginationEl: this.paginationEl, filters: [
          {
            name: "locationId",
            label: "Location",
            endpoint: "listLocations",
            value: this.locationId,
            icon: "business",
            resultsKey: "locations",
          },
        ] })), h("fireenjin-pagination", { disableVirtualScroll: true, removeDuplicates: true, ref: (el) => (this.paginationEl = el), gridEl: ({ result }) => (h("floodteam-snapshot-card", { href: `/locations/${result.id}`, buttonText: "View Location", photo: result === null || result === void 0 ? void 0 : result.photo }, h("ion-label", null, h("h2", null, result.name ? result.name : "")))), listEl: ({ result }) => (h("ion-item", { href: `/locations/${result.id}`, detail: true }, h("ion-label", null, h("h2", null, result.name ? result.name : "", " ")))), endpoint: "listLocations", limit: 20, resultsKey: "locations", query: this.query })),
      h("floodteam-navigation-footer", null),
    ];
  }
};
AppLocationList.style = appLocationListCss;

export { AppLocationList as app_location_list };
