@@ -65,16 +65,57 @@ import { ObjectView } from './ObjectView';
6565
6666// Create renderer wrappers for ComponentRegistry
6767const ObjectGridRenderer : React . FC < { schema : any } > = ( { schema } ) => {
68- // For now, render without dataSource since it requires ObjectQL setup
69- // This allows the component to at least render in documentation
68+ // Check if schema has inline data (staticData or data.items)
69+ const hasInlineData = schema . staticData || ( schema . data ?. provider === 'value' && schema . data ?. items ) ;
70+
71+ // If no inline data and no dataSource will be provided, show placeholder
72+ if ( ! hasInlineData ) {
73+ return (
74+ < div className = "p-4 border border-amber-300 bg-amber-50 rounded-md" >
75+ < p className = "text-amber-800 text-sm" >
76+ ObjectGrid requires either < code className = "bg-amber-100 px-1 rounded" > staticData</ code > or a configured dataSource
77+ </ p >
78+ </ div >
79+ ) ;
80+ }
81+
82+ // For documentation with inline data, render without dataSource
7083 return < ObjectGrid schema = { schema } dataSource = { null as any } /> ;
7184} ;
7285
7386const ObjectFormRenderer : React . FC < { schema : any } > = ( { schema } ) => {
87+ // Check if schema has inline data
88+ const hasInlineData = schema . staticData || ( schema . data ?. provider === 'value' && schema . data ?. items ) ;
89+
90+ // If no inline data and no dataSource will be provided, show placeholder
91+ if ( ! hasInlineData ) {
92+ return (
93+ < div className = "p-4 border border-amber-300 bg-amber-50 rounded-md" >
94+ < p className = "text-amber-800 text-sm" >
95+ ObjectForm requires either < code className = "bg-amber-100 px-1 rounded" > staticData</ code > or a configured dataSource
96+ </ p >
97+ </ div >
98+ ) ;
99+ }
100+
74101 return < ObjectForm schema = { schema } dataSource = { null as any } /> ;
75102} ;
76103
77104const ObjectViewRenderer : React . FC < { schema : any } > = ( { schema } ) => {
105+ // Check if schema has inline data
106+ const hasInlineData = schema . staticData || ( schema . data ?. provider === 'value' && schema . data ?. items ) ;
107+
108+ // If no inline data and no dataSource will be provided, show placeholder
109+ if ( ! hasInlineData ) {
110+ return (
111+ < div className = "p-4 border border-amber-300 bg-amber-50 rounded-md" >
112+ < p className = "text-amber-800 text-sm" >
113+ ObjectView requires either < code className = "bg-amber-100 px-1 rounded" > staticData</ code > or a configured dataSource
114+ </ p >
115+ </ div >
116+ ) ;
117+ }
118+
78119 return < ObjectView schema = { schema } dataSource = { null as any } /> ;
79120} ;
80121
0 commit comments