Downtime catalog

This commit is contained in:
Marcelo
2026-05-06 00:36:48 +00:00
parent 0491237bad
commit bfc1673d89
42 changed files with 8035 additions and 1093 deletions

View File

@@ -0,0 +1,15 @@
import { readFile } from "fs/promises";
import path from "path";
import { parseReasonCatalogMarkdown, type ReasonCatalog } from "@/lib/reasonCatalog";
let catalogPromise: Promise<ReasonCatalog> | null = null;
/** Server-only: reads downtime_menu.md from the repo root. */
export async function loadFallbackReasonCatalog() {
if (!catalogPromise) {
catalogPromise = readFile(path.join(process.cwd(), "downtime_menu.md"), "utf8")
.then((raw) => parseReasonCatalogMarkdown(raw))
.catch(() => ({ version: 1, downtime: [], scrap: [] }));
}
return catalogPromise;
}