import { FlatTemplatable, tempstream } from "tempstream"; import { makeSlug } from "../utils/utils.js"; export function toggleModal(options: { name: string; contentWrapped: (id: string) => FlatTemplatable | Promise; contentUnwrapped: ( id: string ) => FlatTemplatable | Promise; }) { const { contentWrapped, contentUnwrapped, name } = options; const id = makeSlug(name); return tempstream /* HTML */ `
${contentWrapped(id)}
${contentUnwrapped(id)}
`; }