-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.tsx
46 lines (40 loc) · 1.18 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { useEffect } from 'react'
import SearchBox from "./components/SearchBox";
import Facet from "./components/Facet";
import ResultList from "./components/ResultList";
import {
searchBox as SearchBoxController,
facet as FacetController,
resultList as ResultListController,
sort as SortController,
} from './controllers/controllers'
import './App.css'
import { headlessEngine } from "./Engine";
import { criteria, Sort } from './components/Sort';
let didInit = false;
function App() {
useEffect(() => {
if (!didInit) {
didInit = true;
headlessEngine.executeFirstSearch();
}
}, []);
return (
<>
<h1>Coveo Headless Search Interface</h1>
<div className="search-section">
<SearchBox controller={SearchBoxController} />
</div>
<div className="main-section">
<div className="facet-section column">
<Facet controller={FacetController} title="Source" />
</div>
<div className="results-section column">
<Sort controller={SortController} criteria={criteria}/>
<ResultList controller={ResultListController} />
</div>
</div>
</>
)
}
export default App;