import sass from "https://deno.land/x/denosass@1.0.6/mod.ts"; import { Story } from "../wattpad.ts"; import { h, PropsWithChildren } from "../jsx.ts"; import Header from "../components/Header.tsx"; import VR from "../components/VerticalLine.tsx"; interface StoryProps { story: Story; currentHref: string; style?: string; stylepath?: string; } export default (props: PropsWithChildren) => { let chaptersInHeader: { name: string; href: string; element?: unknown }[] = [ { name: "Homepage", href: `/` }, { name: "", href: "", element: }, { name: "Details", href: `/story?id=${props.story.id}` }, { name: "", href: "", element: } ]; chaptersInHeader = chaptersInHeader.concat( props.story.chapters.map((ch, i) => ({ name: ch.name, href: `/story?id=${ch.workID}&chapter=${i}` })) ); return ( {/* favicon stuff generated with https://realfavicongenerator.net */} {props.story.name} {(() => { if (!props.style) props.style = ""; if (props.stylepath) props.style += Deno.readTextFileSync(props.stylepath); else return
; return ; })()}
{props.children}
); };