import { useEffect } from "react"; import { motion } from "motion/react"; import { ArrowRight, Boxes, CheckCircle2, XCircle, Zap } from "lucide-react"; import GlassCard from "../components/GlassCard"; import AnimatedLogo from "../components/AnimatedLogo"; import { useApiKey } from "../context/ApiKeyContext"; import { MINT_THEME } from "../context/ThemeContext"; import { useLaunch } from "./LaunchContext"; import { MODULES, MODULE_IDS } from "./registry"; import { preloadModulePages } from "./lazyPages"; const MODULE_CAPS: Record = { e: ["Sequence automation", "Unified inbox", "Warmup radar", "Deliverability analytics"], s: ["Campaign management", "Lead database", "Webhook automation", "Email warmup"], }; /** * BRIDGE platform hub — the launcher. Real platform primitives only * (GlassCard, AnimatedLogo, API-key status). Buttons trigger the module * launch animation (re-seeded per launch) via LaunchContext. */ export default function ModuleHub() { const { startLaunch } = useLaunch(); const { activeKey } = useApiKey(); useEffect(() => { // Preload both modules' chunks so the first launch never janks. const idle = window.requestIdleCallback ?? ((cb: () => void) => window.setTimeout(cb, 200)); const handle = idle(() => { preloadModulePages("e"); preloadModulePages("s"); }); return () => { if (typeof window.cancelIdleCallback === "function" && typeof handle === "number") { window.cancelIdleCallback(handle); } }; }, []); return (
{/* Ambient layers — platform primitives */}
{/* Header */}
BRIDGEModules
Outbound Systems OS · Platform Hub

Launch a workspace.

Two autonomous outbound engines, one command platform. Each module assembles its own dashboard from live primitives when launched.

{activeKey ? (
API Connected
) : (
API Key Missing — set one in a module's Settings
)}
{/* Module launcher cards — real primitives */}
{MODULE_IDS.map((id) => { const def = MODULES[id]; const Icon = def.icon; const theme = def.theme; const mint = id === "e" ? MINT_THEME : null; return (
{theme.code}

BRIDGE {def.wordmark}

{def.blurb}

    {MODULE_CAPS[id].map((cap) => (
  • {cap}
  • ))}
Slow-mo assembly on launch
{mint && (
GreenTheme build · accent {mint.accent}
)}
); })}
Bridge Modules · Direct URLs — /modules/e · /modules/s
); }