import { Instance, ThermalFileFailure } from "@labir/core"; import { css, html, nothing } from "lit"; import { customElement } from "lit/decorators.js"; import { FileConsumer } from "../../hierarchy/consumers/FileConsumer"; @customElement("file-share-button") export class FileShareButton extends FileConsumer { public onInstanceCreated(): void {} public onFailure(): void {} static styles = css` code { display: block; padding: var( --thermal-gap ); color: var( --thermal-foreground ); background: var( --thermal-background ); white-space: pre-wrap; } `; protected render(): unknown { if ( ! this.file ) { return nothing; } return html` Embed

To display this file on your own website use the following code:

<!-- -Load the JS library (only once, preferrably in the head) -> <script src="https://cdn.jsdelivr.net/npm/@labir/embed/dist/embed.min.js"></script> <!-- The file itself may be placed anywhere in the body --> <thermal-file-app url="${this.file.thermalUrl}"></thermal-file-app>
` } }