import { escapeHtml } from "../lib/html.ts"; import { t } from "../lib/i18n/index.ts"; import { type LayoutOptions, layout } from "./layout.ts"; import { errorBanner, inputClass, primaryButtonClass, THEME, } from "./theme/index.ts"; interface LoginOptions extends LayoutOptions { error?: string; handleValue?: string; } export function loginPage(options?: LoginOptions): string { const locale = options?.locale ?? "en"; const msg = t(locale); const errorHtml = errorBanner(options?.error); const handleValue = options?.handleValue ?? ""; return layout( msg.login.heading, `
${msg.login.description}
${errorHtml}