fix(search): forward all result set properties to the component

Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2023-09-29 13:15:32 +02:00
parent f5eeefc6ea
commit 5aa87b46cf
2 changed files with 10 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-search': patch
---
Forward all result set properties to item components, like highlights, for example.
+5 -3
View File
@@ -200,14 +200,16 @@ export const SearchPage = createPageExtension({
<SearchResults>
{({ results }) =>
results.map((result, index) => {
const { noTrack } = config;
const { document, ...rest } = result;
const SearchResultListItem =
getResultItemComponent(result);
return (
<SearchResultListItem
{...rest}
key={index}
rank={result.rank}
result={result.document}
noTrack={config.noTrack}
result={document}
noTrack={noTrack}
/>
);
})