Files
metabuilder/codegen/src/components/JSONPageRenderer.tsx
johndoe6345789 a51130a127 feat: Add external low-code and postgres repositories
- 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>
2026-01-21 16:48:52 +00:00

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'