// --- Shared layout, nav, and HTML shell --- export interface NavOpts { userName?: string; orgName?: string; email?: string; plan?: string; banner?: { message: string; style?: "info" | "success" | "warning" }; } export interface SeoOpts { title?: string; description?: string; canonical?: string; } export function layout(body: string, title = "Polaris by Lightup", seo?: SeoOpts): Response { const pageTitle = seo?.title ?? title; const description = seo?.description ?? "It's like Gong for Claude Code sessions. Capture every prompt, response, and tool call. Stream to Slack. Collaborate in real time."; const canonical = seo?.canonical ?? "https://app.withpolaris.ai"; const ogImage = "https://app.withpolaris.ai/og-image.png"; return new Response( ` ${pageTitle}
${body}
`, { headers: { "Content-Type": "text/html", "Cache-Control": "no-store" } } ); } export function nav(token?: string, opts?: NavOpts): string { const right = token ? `Decisions Search
` : ` Sign up `; const bannerColors = { info: "bg-polaris-50 border-polaris-200 text-polaris-800", success: "bg-green-50 border-green-200 text-green-800", warning: "bg-amber-50 border-amber-200 text-amber-800", }; const bannerHtml = opts?.banner ? `
${opts.banner.message}
` : ""; return ` ${bannerHtml}`; } export const slackIcon = ``;