import { useState } from 'react' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { JSONUIPage } from '@/components/JSONUIPage' import { Separator } from '@/components/ui/separator' import { Badge } from '@/components/ui/badge' import dashboardExample from '@/config/ui-examples/dashboard.json' import formExample from '@/config/ui-examples/form.json' import tableExample from '@/config/ui-examples/table.json' import settingsExample from '@/config/ui-examples/settings.json' import { FileCode, Eye, Code, ChartBar, ListBullets, Table, Gear } from '@phosphor-icons/react' export function JSONUIShowcase() { const [selectedExample, setSelectedExample] = useState('dashboard') const [showJSON, setShowJSON] = useState(false) const examples = { dashboard: { name: 'Dashboard', description: 'Complete dashboard with stats, activity feed, and quick actions', icon: ChartBar, config: dashboardExample, }, form: { name: 'Form', description: 'Dynamic form with validation and data binding', icon: ListBullets, config: formExample, }, table: { name: 'Data Table', description: 'Interactive table with row actions and looping', icon: Table, config: tableExample, }, settings: { name: 'Settings', description: 'Tabbed settings panel with switches and selections', icon: Gear, config: settingsExample, }, } const currentExample = examples[selectedExample as keyof typeof examples] return (

JSON UI System

Build complex UIs from declarative JSON configurations

EXPERIMENTAL
{Object.entries(examples).map(([key, example]) => { const Icon = example.icon return ( {example.name} ) })}
{Object.entries(examples).map(([key, example]) => ( {showJSON ? (
JSON Configuration {example.description}
                          {JSON.stringify(example.config, null, 2)}
                        
) : ( )}
))}
Fully declarative - no React code needed
Data binding with automatic updates
Event handlers and actions
) }