@@ -13,15 +13,22 @@ import ModalDialog from '../components/ModalDialog'
1313import SlideOver from '../components/SlideOver'
1414import DataGrid from '../components/DataGrid'
1515import AutoForm from '../components/AutoForm'
16+ import AutoQueryGrid from '../components/AutoQueryGrid'
17+ // In production, import from '@servicestack/react':
18+ // import { AutoQueryGrid, ClientContext } from '@servicestack/react'
19+ import { ClientContext } from '../use/context'
1620import { tracks , RoomType } from './data'
17- import { ApiResult , EmptyResponse , IReturn , ResponseStatus } from '@servicestack/client'
21+ import { ApiResult , EmptyResponse , IReturn , ResponseStatus , JsonServiceClient } from '@servicestack/client'
1822import { setMetadata } from '../use/metadata'
1923import { Sole } from '../use/config'
2024import metadataJson from './metadata.json'
2125import PrimaryButton from '../components/PrimaryButton'
2226
2327setMetadata ( metadataJson )
2428
29+ // Create a JsonServiceClient instance for AutoQueryGrid
30+ const client = new JsonServiceClient ( 'https://blazor-gallery.jamstacks.net' )
31+
2532class Forecast {
2633 public date ?: string ;
2734 public temperatureC ?: number ;
@@ -147,6 +154,7 @@ export default function App() {
147154
148155 return (
149156 < >
157+ < ClientContext . Provider value = { client } >
150158 < div className = "absolute top-2 right-2" >
151159 < DarkModeToggle />
152160 </ div >
@@ -404,7 +412,6 @@ export default function App() {
404412 { /* Contextual Validation Test Section */ }
405413 < div className = "max-w-4xl mx-auto p-8" >
406414 < h2 className = "text-2xl font-bold mb-6" > AutoForm Contextual Validation Test</ h2 >
407- < div className = "bg-white dark:bg-gray-800 rounded-lg shadow p-6" >
408415 < p className = "mb-4 text-gray-600 dark:text-gray-400" >
409416 This form demonstrates contextual validation. When you submit, it will return field-specific errors
410417 that are automatically displayed on the corresponding inputs via ApiStateContext.
@@ -449,8 +456,19 @@ export default function App() {
449456 : new ApiResult ( { response : new EmptyResponse ( ) } )
450457 } }
451458 />
459+ </ div >
460+
461+ { /* AutoQuery Bookings Test */ }
462+ < div className = "max-w-4xl mx-auto p-8" >
463+ < h2 className = "text-2xl font-bold mb-6" > AutoQuery Bookings Test</ h2 >
464+ < div className = "bg-white dark:bg-gray-800 rounded-lg shadow p-6" >
465+ < p className = "mb-4 text-gray-600 dark:text-gray-400" >
466+ </ p >
467+ < AutoQueryGrid type = "Booking" />
452468 </ div >
453469 </ div >
470+
471+ </ ClientContext . Provider >
454472 </ >
455473 )
456474}
0 commit comments