26 lines
813 B
TypeScript
26 lines
813 B
TypeScript
import html from '../lib/html.ts'
|
|
|
|
interface Options {
|
|
css: string[]
|
|
preload?: string[]
|
|
script: string
|
|
state: Promise<Record<string, any>>
|
|
}
|
|
|
|
export default ({ css, preload, script, state }: Options) => html`<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>BRF Admin</title>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
<meta name="robots" content="index, follow" />
|
|
${css?.map((href) => `<link rel='stylesheet' crossorigin href='${href}'>`)}
|
|
${preload?.map((href) => `<link rel='modulepreload' crossorigin href='${href}'>`)}
|
|
<script type="module" src="${script}"></script>
|
|
</head>
|
|
<body>
|
|
<div id="container"></div>
|
|
${state?.then((state) => `<script>window.__STATE__ = ${JSON.stringify(state)}</script>`)}
|
|
</body>
|
|
</html>`
|