Page MenuHomeSealhub

form-header.ts
No OneTemporary

form-header.ts

import { Context } from "koa";
import { FormControl } from "./controls";
export class FormHeader extends FormControl {
role = <const>"decoration";
constructor(
public text: string,
public isVisible: (ctx: Context) => Promise<boolean> = async () => true
) {
super();
}
async render(ctx: Context) {
const isVsbl = await this.isVisible(ctx);
return isVsbl ? `<h2>${this.text}</h2>` : "";
}
}

File Metadata

Mime Type
text/x-java
Expires
Tue, May 27, 23:48 (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
661759
Default Alt Text
form-header.ts (406 B)

Event Timeline