import { withHooks } from "@saasquatch/stencil-hooks";
import { Component, h, Host, Method, Prop } from "@stencil/core";
import { useRequestRerender } from "../../../tables/re-render";
/**
 * @uiName Rewards Table Customer Note Column
 * @validParents ["sqm-rewards-table"]
 * @exampleGroup Rewards
 * @example Customer Note Column - <sqm-rewards-table-customer-note-column column-title="Note"></sqm-rewards-table-customer-note-column>
 */
export class RewardTableCustomerNoteColumn {
  constructor() {
    /**
     * @uiName Column title
     */
    this.columnTitle = "Note";
    withHooks(this);
  }
  disconnectedCallback() { }
  async renderCell(data, options) {
    var _a;
    const reward = data;
    return (h("sqm-rewards-table-customer-note-cell", { note: (_a = reward === null || reward === void 0 ? void 0 : reward.meta) === null || _a === void 0 ? void 0 : _a.message, locale: options === null || options === void 0 ? void 0 : options.locale }));
  }
  async renderLabel() {
    return this.columnTitle;
  }
  render() {
    useRequestRerender([this.columnTitle]);
    return h(Host, { style: { display: "none" } });
  }
  static get is() { return "sqm-rewards-table-customer-note-column"; }
  static get encapsulation() { return "shadow"; }
  static get properties() { return {
    "columnTitle": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Column title",
            "name": "uiName"
          }],
        "text": ""
      },
      "attribute": "column-title",
      "reflect": false,
      "defaultValue": "\"Note\""
    }
  }; }
  static get methods() { return {
    "renderCell": {
      "complexType": {
        "signature": "(data: Reward, options?: { locale: string; }) => Promise<any>",
        "parameters": [{
            "tags": [],
            "text": ""
          }, {
            "tags": [],
            "text": ""
          }],
        "references": {
          "Promise": {
            "location": "global"
          },
          "Reward": {
            "location": "import",
            "path": "../../../saasquatch"
          }
        },
        "return": "Promise<any>"
      },
      "docs": {
        "text": "",
        "tags": []
      }
    },
    "renderLabel": {
      "complexType": {
        "signature": "() => Promise<string>",
        "parameters": [],
        "references": {
          "Promise": {
            "location": "global"
          }
        },
        "return": "Promise<string>"
      },
      "docs": {
        "text": "",
        "tags": []
      }
    }
  }; }
}
