feat(search): highlight search result terms
Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
+4
-1
@@ -112,13 +112,14 @@ const SearchPage = () => {
|
||||
<SearchResult>
|
||||
{({ results }) => (
|
||||
<List>
|
||||
{results.map(({ type, document }) => {
|
||||
{results.map(({ type, document, highlight }) => {
|
||||
switch (type) {
|
||||
case 'software-catalog':
|
||||
return (
|
||||
<CatalogSearchResultListItem
|
||||
key={document.location}
|
||||
result={document}
|
||||
highlight={highlight}
|
||||
/>
|
||||
);
|
||||
case 'techdocs':
|
||||
@@ -126,6 +127,7 @@ const SearchPage = () => {
|
||||
<TechDocsSearchResultListItem
|
||||
key={document.location}
|
||||
result={document}
|
||||
highlight={highlight}
|
||||
/>
|
||||
);
|
||||
default:
|
||||
@@ -133,6 +135,7 @@ const SearchPage = () => {
|
||||
<DefaultResultListItem
|
||||
key={document.location}
|
||||
result={document}
|
||||
highlight={highlight}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user