import { Component, h, Prop } from '@stencil/core';
import { __ } from '@wordpress/i18n';
/**
 * @part base - The elements base wrapper.
 * @part heading - The heading.
 * @part heading-text - The heading text wrapper.
 * @part heading-title - The heading title.
 * @part heading-description - The heading description.
 * @part error__base - The alert base wrapper.
 * @part error__icon - The alert icon.
 * @part error__text - The alert text.
 * @part error__title - The alert title.
 * @part error__ message - The alert message.
 */
export class ScDashboardModule {
  render() {
    return (h("div", { class: "dashboard-module", part: "base" },
      !!this.error && (h("sc-alert", { exportparts: "base:error__base, icon:error__icon, text:error__text, title:error__title, message:error__message", open: !!this.error, type: "danger" },
        h("span", { slot: "title" }, __('Error', 'surecart')),
        this.error)),
      h("div", { class: "heading", part: "heading" },
        h("div", { class: "heading__text", part: "heading-text" },
          h("div", { class: "heading__title", part: "heading-title" },
            h("slot", { name: "heading" }, this.heading)),
          h("div", { class: "heading__description", part: "heading-description" },
            h("slot", { name: "description" }))),
        h("slot", { name: "end" })),
      h("slot", null)));
  }
  static get is() { return "sc-dashboard-module"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["sc-dashboard-module.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["sc-dashboard-module.css"]
  }; }
  static get properties() { return {
    "heading": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "heading",
      "reflect": false
    },
    "error": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "error",
      "reflect": false
    },
    "loading": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "loading",
      "reflect": false
    }
  }; }
}
