@@ -3,13 +3,13 @@ import { OramaSearchButton, OramaSearchBox } from '@orama/react-components';
33import { useState , useEffect } from 'react' ;
44
55import { themeConfig } from './config.mjs' ;
6- import { useTheme } from '../../hooks/useTheme.mjs' ;
76
87/**
9- * Search component that provides documentation search functionality using Orama
8+ * Search component that provides documentation search functionality using Orama.
9+ *
10+ * @param {{ theme: string } } props - Component props.
1011 */
11- const MDXSearchBox = ( ) => {
12- const [ colorScheme ] = useTheme ( ) ;
12+ const SearchBox = ( { theme } ) => {
1313 const [ client , setClient ] = useState ( null ) ;
1414 const [ isLoading , setIsLoading ] = useState ( true ) ;
1515
@@ -23,10 +23,8 @@ const MDXSearchBox = () => {
2323 schema : { } ,
2424 } ) ;
2525
26- // Set the client immediately so it's available
2726 setClient ( db ) ;
2827
29- // Then fetch and load the data
3028 const response = await fetch ( 'orama-db.json' ) ;
3129 if ( response . ok ) {
3230 load ( db , await response . json ( ) ) ;
@@ -44,7 +42,7 @@ const MDXSearchBox = () => {
4442 < OramaSearchButton
4543 aria-disabled = { ! client || isLoading }
4644 style = { { flexGrow : 1 } }
47- colorScheme = { colorScheme }
45+ colorScheme = { theme }
4846 themeConfig = { themeConfig }
4947 aria-label = "Search documentation"
5048 >
@@ -55,11 +53,11 @@ const MDXSearchBox = () => {
5553 disableChat = { true }
5654 linksTarget = "_self"
5755 clientInstance = { client }
58- colorScheme = { colorScheme }
56+ colorScheme = { theme }
5957 themeConfig = { themeConfig }
6058 />
6159 </ >
6260 ) ;
6361} ;
6462
65- export default MDXSearchBox ;
63+ export default SearchBox ;
0 commit comments