Update to use react-editor <App /> component

This commit is contained in:
Rami Bitar
2026-05-03 16:22:24 -04:00
parent a78249846a
commit 757118706e
51 changed files with 2294 additions and 2190 deletions

View File

@@ -1,7 +1,5 @@
import { notFound } from "next/navigation";
import { readSchema } from "@/lib/schema.server";
import { resolveSchemaEntry } from "@/lib/schema-resolver";
import RenderClient from "@/components/RenderClient";
import AppClient from "@/components/AppClient";
export const dynamic = "force-dynamic";
@@ -12,16 +10,12 @@ export default async function Page({
}) {
const { path } = await params;
const segments = (path ?? []).filter(Boolean);
const currentPath = segments.length === 0 ? "/" : "/" + segments.join("/");
const pages = await readSchema();
// The /edit branch is handled by app/edit; this catch-all only serves view.
if (segments[0] === "edit") return notFound();
const route = "/" + segments.join("/");
const lookup = route === "/" ? "/" : route.replace(/\/$/, "");
const schema = await readSchema();
const resolved = resolveSchemaEntry(schema, lookup);
if (!resolved) return notFound();
return <RenderClient data={resolved.data} route={lookup} />;
return (
<div style={{ height: "100vh", width: "100vw" }}>
<AppClient pages={pages} currentPath={currentPath} />
</div>
);
}