import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types" // @ts-ignore import script from "./scripts/aetheriaEpubReader.inline" import style from "./styles/aetheriaEpubReader.scss" type FictionReaderConfig = { title: string epubHref: string storageKey: string } const fictionReaders: Record = { "Fiction/The-Burden-of-Proof": { title: "The Burden of Proof", epubHref: "/static/fiction/the-burden-of-proof.epub", storageKey: "aetheria_tbp_reader", }, "Fiction/The-Body-That-Asks": { title: "The Body That Asks", epubHref: "/static/fiction/the-body-that-asks.epub", storageKey: "aetheria_tbta_reader", }, } export const isAetheriaEpubReaderPage = (slug: string | undefined) => Boolean(slug && fictionReaders[slug]) export default (() => { const AetheriaEpubReader: QuartzComponent = ({ fileData }: QuartzComponentProps) => { const config = fileData.slug ? fictionReaders[fileData.slug] : undefined if (!config) return null return (

Ebook edition

Read {config.title}

Download EPUB
Opening book...
) } AetheriaEpubReader.css = style AetheriaEpubReader.afterDOMLoaded = script return AetheriaEpubReader }) satisfies QuartzComponentConstructor