Initial commit
This commit is contained in:
21
app/edit/[[...path]]/page.tsx
Normal file
21
app/edit/[[...path]]/page.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { readSchema } from "~/lib/schema.server";
|
||||
import EditorClient from "~/components/EditorClient";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function EditPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ path?: string[] }>;
|
||||
}) {
|
||||
const { path } = await params;
|
||||
const segments = (path ?? []).filter(Boolean);
|
||||
const route = segments.length === 0 ? "/" : "/" + segments.join("/");
|
||||
const schema = await readSchema();
|
||||
|
||||
return (
|
||||
<div style={{ height: "100vh", width: "100vw" }}>
|
||||
<EditorClient initialSchema={schema} initialPath={route} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user