feat(events): stream Redis invalidations over SSE

This commit is contained in:
2026-08-28 20:03:11 +00:00 Unverified
parent b59a038351
commit 455e4240ac
16 changed files with 453 additions and 1 deletions
+13 -1
View File
@@ -2,6 +2,7 @@ import { notFound, redirect } from "next/navigation";
import { connection } from "next/server";
import { EditorWorkspace } from "@/components/admin/editor-workspace";
import { LiveRefresh } from "@/components/live-refresh";
import { getAdminSession } from "@/lib/auth/server";
import { loadAdminNavigation, loadAdminPage } from "@/lib/content/loaders";
@@ -18,5 +19,16 @@ export default async function AdminEditorPage({
loadAdminNavigation(),
]);
if (!snapshot) notFound();
return <EditorWorkspace snapshot={snapshot} navigation={navigation} />;
return (
<>
{process.env.BUZZ_DEMO_MODE === "true" ? null : (
<LiveRefresh endpoint="/api/events/admin" />
)}
<EditorWorkspace
key={`${snapshot.page.id}:${snapshot.page.version}`}
snapshot={snapshot}
navigation={navigation}
/>
</>
);
}