import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { B as card, h as heading2, C as table, D as tableHeadCell, E as tableCell } from './parts.js';

const DocumentUploadList = /*@__PURE__*/ proxyCustomElement(class DocumentUploadList extends HTMLElement {
    constructor(registerHost) {
        super();
        if (registerHost !== false) {
            this.__registerHost();
        }
        this.documents = [];
    }
    renderStatus(status) {
        switch (status) {
            case 'uploading':
                return h("span", { class: "badge bg-info" }, "Uploading...");
            case 'uploaded':
                return h("span", { class: "badge bg-success" }, "Uploaded");
            case 'error':
                return h("span", { class: "badge bg-danger" }, "Error");
        }
    }
    render() {
        if (!this.documents.length) {
            return null;
        }
        return (h("div", { class: "mt-4" }, h("div", { class: "card", part: card }, h("div", { class: "card-body" }, h("h5", { class: "card-title", part: heading2 }, "Uploaded Documents"), h("div", { class: "table-responsive" }, h("table", { class: "table table-sm table-borderless", part: table }, h("thead", null, h("tr", null, h("th", { style: { width: '25%' }, part: tableHeadCell, scope: "col" }, "Category"), h("th", { style: { width: '25%' }, part: tableHeadCell, scope: "col" }, "Document Type"), h("th", { style: { width: '30%' }, part: tableHeadCell, scope: "col" }, "File Name"), h("th", { style: { width: '20%' }, part: tableHeadCell, scope: "col" }, "Status"))), h("tbody", null, this.documents.map((doc, index) => (h("tr", { class: index === 0 ? 'border-bottom border-top' : 'border-bottom' }, h("td", { part: tableCell }, doc.categoryLabel), h("td", { part: tableCell }, doc.docTypeLabel), h("td", { part: tableCell }, doc.fileName), h("td", { part: tableCell }, this.renderStatus(doc.status))))))))))));
    }
}, [256, "document-upload-list", {
        "documents": [16]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["document-upload-list"];
    components.forEach(tagName => { switch (tagName) {
        case "document-upload-list":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, DocumentUploadList);
            }
            break;
    } });
}
defineCustomElement();

export { DocumentUploadList as D, defineCustomElement as d };
