(
props: Parameters<typeof SearchableExplorer>[0],
options: {
theme?: 'dark' | 'light'
searchable?: boolean
container?: HTMLElement
} = {},
)
| 21 | }) |
| 22 | |
| 23 | function renderExplorer( |
| 24 | props: Parameters<typeof SearchableExplorer>[0], |
| 25 | options: { |
| 26 | theme?: 'dark' | 'light' |
| 27 | searchable?: boolean |
| 28 | container?: HTMLElement |
| 29 | } = {}, |
| 30 | ) { |
| 31 | const theme = options.theme ?? 'dark' |
| 32 | return render( |
| 33 | () => ( |
| 34 | <QueryDevtoolsContext.Provider |
| 35 | value={{ |
| 36 | client: queryClient, |
| 37 | queryFlavor: 'TanStack Query', |
| 38 | version: '5', |
| 39 | onlineManager, |
| 40 | }} |
| 41 | > |
| 42 | <ThemeContext.Provider value={() => theme}> |
| 43 | {options.searchable ? ( |
| 44 | <SearchableExplorer {...props} /> |
| 45 | ) : ( |
| 46 | <Explorer {...props} /> |
| 47 | )} |
| 48 | </ThemeContext.Provider> |
| 49 | </QueryDevtoolsContext.Provider> |
| 50 | ), |
| 51 | { container: options.container }, |
| 52 | ) |
| 53 | } |
| 54 | |
| 55 | function renderSearchable(props: Parameters<typeof SearchableExplorer>[0]) { |
| 56 | return renderExplorer(props, { searchable: true }) |
no test coverage detected