mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 13:44:54 +00:00
Convert TypeScript schemas to JSON with compute functions
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -45,7 +45,10 @@ This project demonstrates a comprehensive JSON-driven UI architecture with atomi
|
||||
|
||||
```typescript
|
||||
import { PageRenderer } from '@/lib/json-ui/page-renderer'
|
||||
import { dashboardSchema } from '@/schemas/dashboard-schema'
|
||||
import { hydrateSchema } from '@/schemas/schema-loader'
|
||||
import analyticsDashboardJson from '@/schemas/analytics-dashboard.json'
|
||||
|
||||
const dashboardSchema = hydrateSchema(analyticsDashboardJson)
|
||||
|
||||
export function DashboardPage() {
|
||||
return <PageRenderer schema={dashboardSchema} />
|
||||
@@ -439,8 +442,12 @@ src/
|
||||
│ ├── component-renderer.tsx
|
||||
│ └── component-registry.tsx
|
||||
├── schemas/ # JSON page schemas
|
||||
│ ├── dashboard-schema.ts
|
||||
│ └── page-schemas.ts
|
||||
│ ├── analytics-dashboard.json
|
||||
│ ├── todo-list.json
|
||||
│ ├── dashboard-simple.json
|
||||
│ ├── new-molecules-showcase.json
|
||||
│ ├── compute-functions.ts
|
||||
│ └── schema-loader.ts
|
||||
└── types/
|
||||
└── json-ui.ts # TypeScript types
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user