@@ -4,7 +4,6 @@ import type { FairDOConfig } from "@/config/FairDOConfig"
4
4
import type { SearchContextState } from "@elastic/search-ui"
5
5
import { FairDOSearchProvider } from "@/components/FairDOSearchProvider"
6
6
import { GlobalModalProvider } from "@/components/GlobalModalProvider"
7
- import { NMRResultView } from "@/components/result/NMRResultView"
8
7
import { ClearFilters } from "@/components/search/ClearFilters"
9
8
import { DefaultFacet , OptionViewProps } from "@/components/search/DefaultFacet"
10
9
import { DefaultSearchBox } from "@/components/search/DefaultSearchBox"
@@ -19,15 +18,23 @@ import "../index.css"
19
18
import "../elastic-ui.css"
20
19
import { TooltipProvider } from "./ui/tooltip"
21
20
import { useAutoDarkMode } from "@/components/utils"
21
+ import { PlaceholderResultView } from "@/components/result/PlaceholderResultView"
22
22
23
23
/**
24
24
* All-in-one component for rendering an elastic search UI based on the provided configuration. Includes
25
- * an interactive graph of related records
26
- * @constructor
25
+ * an interactive graph of related records. Pass in a config object ({@link FairDOConfig}) to configure the search.
26
+ *
27
+ * #### ⚠️ Warning
28
+ *
29
+ * Make sure your configuration is memoized or defined outside of any components
30
+ *
31
+ *
32
+ * #### 🖌️ Customization
33
+ * You can customize the default behaviour by overriding the default result view (resultView) or the views of the facet
34
+ * options (facetOptionView)
27
35
*/
28
36
export function FairDOElasticSearch ( {
29
37
config : rawConfig ,
30
- debug,
31
38
resultView,
32
39
facetOptionView,
33
40
dark
@@ -36,14 +43,13 @@ export function FairDOElasticSearch({
36
43
* Make sure the config is either memoized or constant (defined outside any components)
37
44
*/
38
45
config : FairDOConfig
39
- resultView ? : ComponentType < ResultViewProps >
46
+ resultView : ComponentType < ResultViewProps >
40
47
facetOptionView ?: ComponentType < OptionViewProps >
41
48
42
49
/**
43
50
* Set to true to enable dark mode. Alternatively, set class="dark" on your html or body element
44
51
*/
45
52
dark ?: boolean
46
- debug ?: boolean
47
53
} ) {
48
54
useAutoDarkMode ( dark )
49
55
@@ -60,8 +66,8 @@ export function FairDOElasticSearch({
60
66
} , [ config ] )
61
67
62
68
const actualResultView = useMemo ( ( ) => {
63
- return resultView ?? ( ( props : ResultViewProps ) => < NMRResultView result = { props . result } debug = { debug } /> )
64
- } , [ debug , resultView ] )
69
+ return resultView ?? ( ( props : ResultViewProps ) => < PlaceholderResultView { ... props } /> )
70
+ } , [ resultView ] )
65
71
66
72
return (
67
73
< SearchProvider config = { elasticConfig } >
@@ -112,7 +118,7 @@ export function FairDOElasticSearch({
112
118
< >
113
119
{ isLoading && ! wasSearched && (
114
120
< div className = "rfs-flex rfs-justify-center" >
115
- < LoaderCircle className = "size-6 animate-spin" />
121
+ < LoaderCircle className = "rfs- size-6 rfs- animate-spin" />
116
122
</ div >
117
123
) }
118
124
0 commit comments