${item!.name || item!.title
? html`
${item!.name || item!.title}
`
: nothing}
${item!.filename}
${item!.resources
? html`
${map(
item!.resources,
(resource) =>
html`-
${resource.name + "\n"}
`,
)}
`
: nothing}
${this.renderSource()}
${domain
? html`
${domain}
${certFingerprintUrl
? html` View Certificate`
: nothing}
`
: nothing}
${software
? html`
${software || "Unknown"}
`
: nothing}
${numValid > 0 || numInvalid > 0
? html`
${numValid} hashes
verified${numInvalid ? html`, ${numInvalid} invalid` : nothing}
`
: html` Not Available`}
${datapackageHash || "Not Available"}
${publicKey || "Not Available"}
${item!.onDemand ? "Download On-Demand" : "Fully Local"}
`;
}
render() {
return this.detailed ? this.renderDetailed() : this.renderSummaryView();
}
onCopy(event: Event, text: string | undefined) {
event.preventDefault();
event.stopPropagation();
// TODO: Fix this the next time the file is edited.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
if (text) navigator.clipboard.writeText(text);
return false;
}
// @ts-expect-error [// TODO: Fix this the next time the file is edited.] - TS7006 - Parameter 'reload' implicitly has an 'any' type.
onPurge(reload) {
const detail = { reload };
this.dispatchEvent(new CustomEvent("item-purge", { detail }));
}
}
customElements.define("wr-item-info", ItemInfo);
export { ItemInfo };