import { h, Build, } from "@stencil/core";
export class AppDotList {
  constructor() {
    this.paginationEl = undefined;
    this.query = undefined;
  }
  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: "/dots" }, "Dots"), h("ion-buttons", { slot: "end" }, h("ion-button", { fill: "solid", color: "primary", href: "/dots/new" }, "Add"))), h("div", { class: "ion-padding" }, h("fireenjin-search-bar", { ref: (el) => (this.filterBarEl = el), paginationEl: this.paginationEl, filters: null })), h("fireenjin-pagination", { ref: (el) => (this.paginationEl = el), gridEl: ({ result }) => (h("floodteam-snapshot-card", { href: `/dot/${result.id}`, buttonText: "View Dot" }, h("ion-label", null, h("h2", null, result.placement ? result.placement : "")))), listEl: ({ result }) => (h("ion-item", { href: `/dot/${result.id}`, detail: true }, h("ion-label", null, h("h2", null, result.placement ? result.placement : "")))), endpoint: "listDots", limit: 20, resultsKey: "dots", query: this.query, name: "dots" })),
      h("floodteam-navigation-footer", null),
    ];
  }
  static get is() { return "app-dot-list"; }
  static get originalStyleUrls() {
    return {
      "$": ["app-dot-list.css"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["app-dot-list.css"]
    };
  }
  static get states() {
    return {
      "paginationEl": {},
      "query": {}
    };
  }
  static get listeners() {
    return [{
        "name": "ionInput",
        "method": "onSearchInput",
        "target": undefined,
        "capture": false,
        "passive": false
      }];
  }
}
