feat(search): highlight search result terms

Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
Phil Kuang
2022-04-20 00:05:52 -04:00
parent 894f4022b6
commit 3a74e203a8
42 changed files with 947 additions and 69 deletions
@@ -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}
/>
);
}