Skip to content

Commit

Permalink
show error of references that have no books
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnmclean committed Dec 19, 2024
1 parent b2a0901 commit e4bc8e8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function Connections({ knowledge }: ConnectionsProps) {
? "references"
: "replies",
);

return (
<Tabs
aria-label="Comment Options"
Expand Down Expand Up @@ -54,7 +55,9 @@ export function Connections({ knowledge }: ConnectionsProps) {
<LibraryBigIcon />
<span>References</span>
<Chip size="sm" variant="solid">
3
{knowledge.SourceConnections?.filter(
(c) => c.type !== "main_reference" && c.type !== "comment",
).length ?? 0}
</Chip>
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,24 @@ function BookReference({
const book = knowledgeConnection.TargetKnowledge?.Book;
const authors = book?.authors as unknown as string[];

if (!book) return null;
if (!book)
return (
<Card className="border-1 border-danger-300 bg-danger-50">
<CardBody>
<p className="text-danger-600">Error retrieving book information</p>
<p className="text-sm text-foreground/80">
Notes: {knowledgeConnection.notes}
</p>
<p className="text-sm text-foreground/80">
Error: {knowledgeConnection.TargetKnowledge?.jobError}
</p>
<p>
Query: {knowledgeConnection.TargetKnowledge?.query} -{" "}
{knowledgeConnection.TargetKnowledge?.queryType}
</p>
</CardBody>
</Card>
);

return (
<Card className="border border-default-200">
Expand Down

0 comments on commit e4bc8e8

Please sign in to comment.