import { Build, Component, h, Listen, State, } from "@stencil/core";
export class AppLogList {
  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: "/logs" }, "Logs"),
          h("ion-buttons", { slot: "end" },
            h("ion-button", { fill: "solid", color: "primary", href: "/logs/new" }, "Add"))),
        h("div", { class: "ion-padding" },
          h("fireenjin-search-bar", { ref: (el) => (this.filterBarEl = el), paginationEl: this.paginationEl, filters: null })),
        h("fireenjin-filter-bar", { paginationEl: this.paginationEl, filter: {
            label: "Filter By",
            controls: [
              {
                name: "locationId",
                label: "Location",
                endpoint: "listLocations",
                icon: "business",
                dataPropsMap: {
                  locations: "results",
                },
              },
              {
                name: "type",
                label: "Type",
                icon: "pricetags",
                multiple: true,
                options: [
                  { label: "Write", value: "Mutation" },
                  { label: "Read", value: "Query" },
                  { label: "Stripe", value: "stripe" },
                  { label: "AnswerConnect", value: "answerconnect" },
                ],
              },
            ],
          } }),
        h("fireenjin-pagination", { ref: (el) => (this.paginationEl = el), listEl: ({ result: log }) => (h("fireenjin-log-item", { ...log })), display: "list", endpoint: "listLogs", limit: 20, resultsKey: "logs", query: this.query })),
      h("floodteam-navigation-footer", null),
    ];
  }
  static get is() { return "app-log-list"; }
  static get originalStyleUrls() { return {
    "$": ["app-log-list.css"]
  }; }
  static get styleUrls() { return {
    "$": ["app-log-list.css"]
  }; }
  static get states() { return {
    "query": {},
    "paginationEl": {}
  }; }
  static get listeners() { return [{
      "name": "ionInput",
      "method": "onSearchInput",
      "target": undefined,
      "capture": false,
      "passive": false
    }]; }
}
