import { Component, Element, Event, h, Prop, State } from "@stencil/core";
import { getWarningMessage } from "../../../../../model";
import * as translation from "../../../../translation";
export class IntergiroLogTableRow {
  componentWillLoad() {
    this.t = translation.create(this.element);
  }
  handleColumnClick(column) {
    this.columnClicked.emit({ index: this.index, column });
  }
  render() {
    const t = this.t;
    return [
      h("td", null, t(this.entry.level)),
      h("td", null, t(this.entry.point)),
      h("td", null,
        h("section", { class: "openable" + (this.opened == "data" ? " opened" : ""), onClick: () => this.handleColumnClick("data") }, t(this.entry.level == "warning" ? getWarningMessage(this.entry) : "details"))),
    ];
  }
  static get is() { return "ig-entry-table-row"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["style.css"]
  }; }
  static get styleUrls() { return {
    "$": ["style.css"]
  }; }
  static get properties() { return {
    "entry": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "Log.Entry",
        "resolved": "Entry",
        "references": {
          "Log": {
            "location": "import",
            "path": "@payfunc/model-log"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "index": {
      "type": "number",
      "mutable": false,
      "complexType": {
        "original": "number",
        "resolved": "number",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "index",
      "reflect": false
    },
    "opened": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "opened",
      "reflect": false
    }
  }; }
  static get states() { return {
    "t": {}
  }; }
  static get events() { return [{
      "method": "columnClicked",
      "name": "columnClicked",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }]; }
  static get elementRef() { return "element"; }
}
