Skip to content
Snippets Groups Projects
Commit 8b81b179 authored by Marcus Schiesser's avatar Marcus Schiesser
Browse files

fix: only render sources with metadata

parent f1c3e8df
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ export function ChatSources({ data }: { data: SourceData }) {
const sources = useMemo(() => {
return (
data.nodes
?.filter((node) => Object.keys(node.metadata).length > 0)
?.filter((node) => (node.score ?? 1) > SCORE_THRESHOLD)
.sort((a, b) => (b.score ?? 1) - (a.score ?? 1)) || []
);
......@@ -84,5 +85,10 @@ function NodeInfo({ node }: { node: SourceNode }) {
// node generated by unknown loader, implement renderer by analyzing logged out metadata
console.log("Node metadata", node.metadata);
return <p>Sorry, unknown node type. Please add a new renderer.</p>;
return (
<p>
Sorry, unknown node type. Please add a new renderer in the NodeInfo
component.
</p>
);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment