import { Component, Element, h, Prop, State } from "@stencil/core";
import { Contact } from "@payfunc/model";
import * as translation from "./translation";
export class IntergiroOrdersTableDetails {
  constructor() {
    this.opened = "";
    this.selected = false;
  }
  componentWillLoad() {
    this.t = translation.create(this.element);
  }
  render() {
    let result;
    switch (this.opened) {
      case "number":
        result = (h("ig-number-details", { identifier: this.order.id, number: this.order.number, name: "order" }));
        break;
      case "contact":
        result = (h("ig-order-contact", { contact: Contact.is(this.order.customer) ? this.order.customer : undefined }));
        break;
      case "items":
        result = h("ig-order-items", { order: this.order });
        break;
      case "payment":
        result = h("ig-order-payment", { order: this.order });
        break;
      case "created":
        result = (h("ig-order-events", { event: this.order.event, currency: this.order.currency, payment: this.order.payment }));
        break;
      default:
        result = [];
        break;
    }
    return Array.isArray(result) && result.length == 0 ? result : [h("td", { colSpan: 8 }, result)];
  }
  static get is() { return "ig-orders-table-details"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["style.css"]
  }; }
  static get styleUrls() { return {
    "$": ["style.css"]
  }; }
  static get properties() { return {
    "opened": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "\"\" | \"number\" | \"contact\" | \"items\" | \"payment\" | \"created\"",
        "resolved": "\"\" | \"contact\" | \"created\" | \"items\" | \"number\" | \"payment\"",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "opened",
      "reflect": false,
      "defaultValue": "\"\""
    },
    "order": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "Order",
        "resolved": "Order",
        "references": {
          "Order": {
            "location": "import",
            "path": "@payfunc/model"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "selected": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "selected",
      "reflect": false,
      "defaultValue": "false"
    }
  }; }
  static get states() { return {
    "t": {}
  }; }
  static get elementRef() { return "element"; }
}
