import { _t } from '../i18n/i18n';
export class DownloadList {
    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)
                formatString = `(${formatString})`;
            return (h("ion-item", null,
                h("ion-label", { "text-wrap": true },
                    file.label,
                    " ",
                    formatString),
                h("ion-button", { slot: "end", href: file.url, 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": "Any",
            "attr": "files"
        }
    }; }
}
