@@ -342,7 +342,12 @@ const MyCustomList = () => {
342342 } ) ;
343343
344344 return (
345- < DataTable data = { data } total = { total } isPending = { isPending } >
345+ < DataTable
346+ data = { data }
347+ total = { total }
348+ isPending = { isPending }
349+ resource = "books"
350+ >
346351 < DataTable . Col source = "id" />
347352 < DataTable . Col source = "title" />
348353 </ DataTable >
@@ -351,9 +356,31 @@ const MyCustomList = () => {
351356
352357export const StandaloneStatic = ( ) => (
353358 < AdminContext dataProvider = { dataProvider } theme = { theme } >
354- < ResourceContextProvider value = "books" >
355- < MyCustomList />
356- </ ResourceContextProvider >
359+ < MyCustomList />
360+ </ AdminContext >
361+ ) ;
362+
363+ const MyCustomListNoResults = ( ) => {
364+ const { data, total, isPending } = useGetList ( 'books' , {
365+ filter : { title : 'Non-existing book' } ,
366+ } ) ;
367+
368+ return (
369+ < DataTable
370+ data = { data }
371+ total = { total }
372+ isPending = { isPending }
373+ resource = "books"
374+ >
375+ < DataTable . Col source = "id" />
376+ < DataTable . Col source = "title" />
377+ </ DataTable >
378+ ) ;
379+ } ;
380+
381+ export const StandaloneNoResults = ( ) => (
382+ < AdminContext dataProvider = { dataProvider } theme = { theme } >
383+ < MyCustomListNoResults />
357384 </ AdminContext >
358385) ;
359386
@@ -366,19 +393,19 @@ const MyCustomListInteractive = () => {
366393
367394 return (
368395 < ListContextProvider value = { listContext } >
369- < DataTable sx = { { mt : 6 } } >
370- < DataTable . Col source = "id" />
371- < DataTable . Col source = "title" />
372- </ DataTable >
396+ < ResourceContextProvider value = "books" >
397+ < DataTable sx = { { mt : 6 } } >
398+ < DataTable . Col source = "id" />
399+ < DataTable . Col source = "title" />
400+ </ DataTable >
401+ </ ResourceContextProvider >
373402 </ ListContextProvider >
374403 ) ;
375404} ;
376405
377406export const StandaloneDynamic = ( ) => (
378407 < AdminContext dataProvider = { dataProvider } theme = { theme } >
379- < ResourceContextProvider value = "books" >
380- < MyCustomListInteractive />
381- </ ResourceContextProvider >
408+ < MyCustomListInteractive />
382409 </ AdminContext >
383410) ;
384411
0 commit comments