mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-27 15:24:56 +00:00
- codegen: Low-code React app with JSON-driven component system - packagerepo: Schema-driven package repository with backend/frontend - postgres: Next.js app with Drizzle ORM and PostgreSQL Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
33 lines
906 B
TypeScript
33 lines
906 B
TypeScript
import pageRendererCopy from '@/config/json-page-renderer.json'
|
|
import { PageSectionRenderer } from '@/components/json-page-renderer/SectionRenderer'
|
|
import { ComponentRendererProps } from '@/components/json-page-renderer/types'
|
|
|
|
export function JSONPageRenderer({
|
|
config,
|
|
schema,
|
|
data = {},
|
|
functions = {},
|
|
}: ComponentRendererProps) {
|
|
const pageSchema = config || schema
|
|
if (!pageSchema) {
|
|
return <div>{pageRendererCopy.fallbackText}</div>
|
|
}
|
|
|
|
return (
|
|
<div className="h-full overflow-auto p-6 space-y-6">
|
|
{pageSchema.layout.sections?.map((section, index) => (
|
|
<PageSectionRenderer
|
|
key={index}
|
|
index={index}
|
|
section={section}
|
|
pageSchema={pageSchema}
|
|
data={data}
|
|
functions={functions}
|
|
/>
|
|
))}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export type { ComponentRendererProps } from '@/components/json-page-renderer/types'
|