import { Component, h, Prop } from "@stencil/core";
import state from "../../store";
export class FormSiteInfo {
  render() {
    var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
    return (h("fireenjin-form", { name: "info", endpoint: ((_a = state.site) === null || _a === void 0 ? void 0 : _a.id) ? "editSite" : "addSite", submitButton: ((_b = state.site) === null || _b === void 0 ? void 0 : _b.id) ? "Save" : "Next", resetButton: ((_c = state.site) === null || _c === void 0 ? void 0 : _c.id) ? "Delete Site" : null, resetButtonColor: "danger", beforeSubmit: (data) => ({
        ...data,
        jobId: this.jobId,
        chamber: ((data === null || data === void 0 ? void 0 : data.chamber) && parseInt(data.chamber)) || 0,
        class: ((data === null || data === void 0 ? void 0 : data.class) && parseInt(data.class)) || 0,
        level: ((data === null || data === void 0 ? void 0 : data.level) && parseInt(data.level)) || 0,
        offsets: ((data === null || data === void 0 ? void 0 : data.offsets) && parseInt(data.offsets)) || 0,
      }), documentId: (_d = state.site) === null || _d === void 0 ? void 0 : _d.id, disableLoader: true, disableEnterButton: true },
      h("ion-grid", null,
        h("ion-row", null,
          h("ion-col", null,
            h("floodteam-input-room", { label: "Room", labelPosition: "stacked", value: (_e = state.site) === null || _e === void 0 ? void 0 : _e.name, required: true }))),
        h("ion-row", null,
          h("ion-col", { size: "6", sizeSm: "3" },
            h("fireenjin-input", { label: "Level", labelPosition: "stacked", type: "number", placeholder: "What level is the site on?", name: "level", value: (_f = state.site) === null || _f === void 0 ? void 0 : _f.level })),
          h("ion-col", { size: "6", sizeSm: "3" },
            h("fireenjin-input", { label: "Chamber", labelPosition: "stacked", type: "number", placeholder: "What drying chamber is this in?", name: "chamber", value: (_g = state.site) === null || _g === void 0 ? void 0 : _g.chamber })),
          h("ion-col", { size: "6", sizeSm: "3" },
            h("fireenjin-input", { label: "Offsets", labelPosition: "stacked", type: "number", placeholder: "Wall Offsets", name: "offsets", value: (_h = state.site) === null || _h === void 0 ? void 0 : _h.offsets })),
          h("ion-col", { size: "6", sizeSm: "3" },
            h("fireenjin-input", { label: "Class", labelPosition: "stacked", type: "number", placeholder: "What class of water loss in this site?", name: "class", value: (_j = state.site) === null || _j === void 0 ? void 0 : _j.class }))),
        h("ion-row", null,
          h("ion-col", null,
            h("ion-item-divider", null, "Material Info"))),
        h("ion-row", null,
          h("ion-col", { size: "12", sizeSm: "6", sizeMd: "4" },
            h("floodteam-input-material", { label: "Flooring", labelPosition: "stacked", name: "floorType", options: [
                {
                  label: "Tile",
                  value: "tile",
                },
                {
                  label: "Carpet & Pad",
                  value: "carpet",
                },
                {
                  label: "Concrete",
                  value: "concrete",
                },
                {
                  label: "Wood",
                  value: "wood",
                },
              ], value: (_k = state.site) === null || _k === void 0 ? void 0 : _k.floorType })),
          h("ion-col", { size: "12", sizeSm: "6", sizeMd: "4" },
            h("floodteam-input-material", { label: "Walling", labelPosition: "stacked", name: "wallType", options: [
                {
                  label: "Drywall",
                  value: "drywall",
                },
                {
                  label: "Insulation",
                  value: "insulation",
                },
              ], value: (_l = state.site) === null || _l === void 0 ? void 0 : _l.wallType })),
          h("ion-col", { size: "12", sizeSm: "6", sizeMd: "4" },
            h("floodteam-input-material", { label: "Ceiling Type", labelPosition: "stacked", name: "ceilingType", value: (_m = state.site) === null || _m === void 0 ? void 0 : _m.ceilingType }))))));
  }
  static get is() { return "floodteam-form-site-info"; }
  static get properties() { return {
    "jobId": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "job-id",
      "reflect": false
    }
  }; }
}
//# sourceMappingURL=form-site-info.js.map