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 'draft':
        return 'info';
      case 'requires_approval':
      case 'finalized':
        return 'warning';
      case 'paid':
        return 'success';
      case 'payment_intent_canceled':
      case 'payment_failed':
        return 'danger';
    }
  }
  getText() {
    switch (this.status) {
      case 'draft':
        return __('Draft', 'surecart');
      case 'finalized':
        return __('Pending Payment', 'surecart');
      case 'paid':
        return __('Paid', 'surecart');
      case 'payment_intent_canceled':
        return __('Cancelled', 'surecart');
      case 'payment_failed':
        return __('Failed', 'surecart');
      case 'requires_approval':
        return __('Requires Approval', '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": "\"draft\" | \"finalized\" | \"paid\" | \"payment_failed\" | \"payment_intent_canceled\" | \"requires_approval\"",
        "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"
    }
  }; }
}
