import { SITE_DEFAULT_META, SITE_TITLE } from "./constants.js"; import { JSX } from "preact/jsx-runtime"; type Props = { title?: string; meta?: { [name: string]: string }; asset(path: string): string; } & ({ content: string } | { Content(): JSX.Element }); export default (props: Props) => { const metaTags = Object.entries(Object.assign({}, SITE_DEFAULT_META, props.meta || {})).map( ([name, value]) => , ); return ( {metaTags} <link rel="stylesheet" type="text/css" href={props.asset("index.css")} /> </head> <body> {"Content" in props ? ( <div class="main"> <props.Content /> </div> ) : ( <div class="main" dangerouslySetInnerHTML={{ __html: props.content }} /> )} </body> </html> ); };