import { FormControl, FormControlContext } from "./form-control.js"; export class FormHeader extends FormControl { role = "decoration"; constructor( public text: string, public isVisible: ( fctx: FormControlContext ) => Promise = async () => true ) { super(); } async render(fctx: FormControlContext) { const isVsbl = await this.isVisible(fctx); return isVsbl ? `

${this.text}

` : ""; } }