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

const appVehicleListCss = "";

let AppVehicleList = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  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: "/vehicles" }, "Vehicles"), h("ion-buttons", { slot: "end" }, h("ion-button", { fill: "solid", color: "primary", href: "/vehicles/new" }, "Add"))), h("div", { class: "ion-padding" }, h("fireenjin-search-bar", { ref: (el) => (this.filterBarEl = el), paginationEl: this.paginationEl, filters: [] })), h("fireenjin-filter-bar", { paginationEl: this.paginationEl, modeToggle: true, filter: {
          label: "Filter By",
          controls: [
            {
              name: "locationId",
              label: "Location",
              endpoint: "listLocations",
              icon: "business",
              resultsKey: "locations",
            },
          ],
        }, sort: {
          header: "Sort By",
          value: "createdAt:desc",
          options: [
            {
              label: "Created At",
              value: "createdAt:desc",
            },
            {
              label: "Name",
              value: "name",
            },
          ],
        } }), h("fireenjin-pagination", { ref: (el) => (this.paginationEl = el), gridEl: ({ result }) => (h("floodteam-snapshot-card", { href: `/vehicle/${result.id}`, buttonText: "View Vehicle" }, h("ion-label", null, h("h2", null, result.name ? result.name : "")))), listEl: ({ result }) => (h("ion-item", { href: `/vehicles/${result.id}`, detail: true }, h("ion-label", null, h("h2", null, result.name ? result.name : "", " ")))), endpoint: "listVehicles", limit: 20, resultsKey: "vehicles", query: this.query })),
      h("floodteam-navigation-footer", null),
    ];
  }
};
AppVehicleList.style = appVehicleListCss;

export { AppVehicleList as app_vehicle_list };

//# sourceMappingURL=app-vehicle-list.entry.js.map