caelum0x 2299eb1ba5 feat(mail): customer dashboard (no-build HTML + vanilla JS)
Login via our own magic links, 3-step onboarding (domain, DNS records, first send),
emails with status timeline, domains, API keys (live/test), webhooks, suppressions,
team, usage + plan. Live/Test switch everywhere. Dev mock server + MOUNT.md listing
the one-line axum mount and missing API pieces. Verified in a headless browser
against the mock (24 screenshots).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 04:24:04 +03:00

20 lines
709 B
JavaScript

// Hash router: "#/emails/abc" -> { name: "emails", id: "abc", query: {} }.
const routes = new Map();
export const route = (name, handler) => routes.set(name, handler);
export function parse(hash = location.hash) {
const raw = hash.replace(/^#\/?/, "");
const [pathPart, queryPart = ""] = raw.split("?");
const [name = "", id = "", sub = ""] = pathPart.split("/").map(decodeURIComponent);
return { name, id, sub, query: Object.fromEntries(new URLSearchParams(queryPart)) };
}
export const navigate = (path) => {
if (location.hash === `#${path}`) window.dispatchEvent(new HashChangeEvent("hashchange"));
else location.hash = path;
};
export const handler = (name) => routes.get(name) || null;