import { Component, h, Prop } from '@stencil/core';
import { __ } from '@wordpress/i18n';
export class ScOrderStatusBadge {
  constructor() {
    /** The tag's size. */
    this.size = 'medium';
    /** Draws a pill-style tag with rounded edges. */
    this.pill = false;
    /** Makes the tag clearable. */
    this.clearable = false;
  }
  getType() {
    switch (this.status) {
      case 'processing':
        return 'warning';
      case 'paid':
        return 'success';
      case 'payment_failed':
        return 'danger';
      case 'canceled':
        return 'danger';
      case 'void':
        return 'default';
      case 'canceled':
        return 'danger';
    }
  }
  getText() {
    switch (this.status) {
      case 'processing':
        return __('Processing', 'surecart');
      case 'payment_failed':
        return __('Payment Failed', 'surecart');
      case 'paid':
        return __('Paid', 'surecart');
      case 'canceled':
        return __('Canceled', 'surecart');
      case 'void':
        return __('Void', 'surecart');
      case 'canceled':
        return __('Canceled', 'surecart');
      default:
        return this.status;
    }
  }
  render() {
    return h("sc-tag", { type: this.getType() }, this.getText());
  }
  static get is() { return "sc-order-status-badge"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["sc-order-status-badge.css"]
  }; }
  static get styleUrls() { return {
    "$": ["sc-order-status-badge.css"]
  }; }
  static get properties() { return {
    "status": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "OrderStatus",
        "resolved": "\"canceled\" | \"paid\" | \"payment_failed\" | \"processing\" | \"void\"",
        "references": {
          "OrderStatus": {
            "location": "import",
            "path": "../../../types"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The tag's statux type."
      },
      "attribute": "status",
      "reflect": false
    },
    "size": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "'small' | 'medium' | 'large'",
        "resolved": "\"large\" | \"medium\" | \"small\"",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "The tag's size."
      },
      "attribute": "size",
      "reflect": true,
      "defaultValue": "'medium'"
    },
    "pill": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Draws a pill-style tag with rounded edges."
      },
      "attribute": "pill",
      "reflect": true,
      "defaultValue": "false"
    },
    "clearable": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": "Makes the tag clearable."
      },
      "attribute": "clearable",
      "reflect": false,
      "defaultValue": "false"
    }
  }; }
}
