import { h } from "../jsx.ts"; import { Context } from "../oak.ts"; import Story from "../templates/Story.tsx"; import watt from "../wattpad.ts"; import FourOhFour from "./404.tsx"; import Script from "../components/Script.tsx"; import StoryButtonScript from "../scripts/Story.ts"; import StoryProgressSavingScript from "../scripts/StoryProgressSaving.ts"; import ScrollHeader from "../scripts/ScrollHeader.ts"; export default async (params: URLSearchParams, ctx: Context) => { if (!params.get("id")) return FourOhFour(undefined, ctx); const story = await watt.getStory(params.get("id") as string, false); // chapters if (params.get("chapter")) { await story.chapters[Number(params.get("chapter") as string)].init(); return (