import { html, type Html } from "./html.ts"; export interface Flash { msg?: string; err?: string; reasons?: string[]; } const nav: [string, string][] = [ ["/", "Overview"], ["/site", "Site pages"], ["/launch", "Before launch"], ["/review", "Review"], ["/inbox", "Inbox"], ["/notes", "Notes"], ["/drafts", "Drafts"], ["/posts", "Posts"], ["/images", "Images"], ["/capture", "Capture"], ["/store", "Store"], ["/problems", "Problems"], ]; export function layout(p: { title: string; path: string; held: number; inbox?: number; flash?: Flash; body: Html }): Html { const current = (href: string) => (href === "/" ? p.path === "/" : p.path.startsWith(href)); return html` ${p.title} ยท GregKilmer.com admin
GregKilmer.com admin
${p.flash?.msg ? html`
${p.flash.msg}
` : ""} ${p.flash?.err ? html`` : ""} ${p.body}
`; }