import { h } from "@stencil/core";
import { _t } from "../i18n/i18n";
export class DownloadList {
  constructor() {
    this.files = undefined;
  }
  render() {
    const header = _t("webmapgl.download-list.header");
    let fileList = this.files.map((file) => {
      let formatString = [file.format, file.size]
        .filter((item) => item)
        .join(", ");
      if (formatString != undefined)
        formatString = `(${formatString})`;
      return (h("ion-item", null, h("ion-label", { "text-wrap": true }, file.label, " ", formatString), h("ion-button", { slot: "end", href: file.url, target: "_blank", title: _t("webmapgl.download-list.download", { file: file.label }) }, h("ion-icon", { slot: "icon-only", name: "download" }))));
    });
    return (h("ion-content", null, h("ion-list", null, h("ion-list-header", null, header), fileList)));
  }
  static get is() { return "gl-download-list"; }
  static get properties() {
    return {
      "files": {
        "type": "unknown",
        "mutable": false,
        "complexType": {
          "original": "HTMLGlDownloadFileElement[]",
          "resolved": "HTMLGlDownloadFileElement[]",
          "references": {
            "HTMLGlDownloadFileElement": {
              "location": "global",
              "id": "global::HTMLGlDownloadFileElement"
            }
          }
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Array of [gl-download-file](../download-file) elements to be included\nin the list."
        }
      }
    };
  }
}
//# sourceMappingURL=download-list.js.map
