${!this.currentSize ? nothing : this.renderProgressBar()}
${!this.embed
? html` `
: ""}
`;
case "errored":
return html` `;
case "permission_needed":
return html`
Permission is needed to reload the archive file. (Click
Cancel to cancel loading this archive.)
Cancel
`;
case "waiting":
default:
return html``;
}
}
private renderProgressBar() {
// Calculate percentage based on currentSize and totalSize
// if data is available before actual percent
const percent =
this.currentSize && this.totalSize
? Math.max(this.percent, (this.currentSize / this.totalSize) * 100)
: this.percent;
// Round up <1 percentages
const displayPercent = percent ? Math.max(percent, 1) : undefined;
return html`