import { Component, Element, h, Prop, State } from "@stencil/core";
import * as translation from "../../translation";
export class IntergiroMonitorSettlementsFees {
  constructor() {
    this.fees = [];
  }
  componentWillLoad() {
    this.t = translation.create(this.element);
  }
  render() {
    return (this.fees.length > 0 && (h("table", null,
      h("th", { color: "light" }, this.t("scheme")),
      h("th", { color: "light" }, this.t("gross")),
      h("th", { color: "light" }, this.t("fee")),
      this.costPlus && h("th", { color: "light" }, this.t("interchange")),
      h("th", { color: "light" }, this.t("net")),
      this.fees
        .sort((a, b) => (a.scheme > b.scheme ? 1 : -1))
        .map(f => (h("tr", null,
        h("smoothly-display", null, f.scheme),
        h("smoothly-display-amount", { amount: f.gross, currency: f.currency }),
        h("smoothly-display-amount", { amount: f.fee, currency: f.currency }),
        this.costPlus && (h("smoothly-display-amount", { amount: f.interchange, currency: f.currency })),
        h("smoothly-display-amount", { amount: f.net, currency: f.currency })))))));
  }
  static get is() { return "ig-monitor-settlements-fees"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["style.css"]
  }; }
  static get styleUrls() { return {
    "$": ["style.css"]
  }; }
  static get properties() { return {
    "fees": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "{\n\t\tscheme: string\n\t\tgross: number\n\t\tfee: number\n\t\tnet: number\n\t\tinterchange: number\n\t\tcurrency: Currency\n\t}[]",
        "resolved": "{ scheme: string; gross: number; fee: number; net: number; interchange: number; currency: Currency; }[]",
        "references": {
          "Currency": {
            "location": "import",
            "path": "isoly"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "defaultValue": "[]"
    },
    "costPlus": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean | undefined",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "cost-plus",
      "reflect": false
    }
  }; }
  static get states() { return {
    "t": {}
  }; }
  static get elementRef() { return "element"; }
}
