Skip to content

Commit

Permalink
feat: show capa content summary on cards in library search results
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Sep 17, 2024
1 parent c46692b commit 3b6947e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/library-authoring/components/ComponentCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const contentHit: ContentHit = {
tags: {
level0: ['1', '2', '3'],
},
blockType: 'text',
blockType: 'html',
created: 1722434322294,
modified: 1722434322294,
lastPublished: null,
Expand Down
6 changes: 5 additions & 1 deletion src/library-authoring/components/ComponentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ const ComponentCard = ({ contentHit, blockTypeDisplayName } : ComponentCardProps
tags,
usageKey,
} = contentHit;
const description = formatted?.content?.htmlContent ?? '';
const description: string = (/* eslint-disable */
blockType === 'html' ? formatted?.content?.htmlContent :
blockType === 'problem' ? formatted?.content?.capaContent :
undefined
) ?? '';/* eslint-enable */
const displayName = formatted?.displayName ?? '';

return (
Expand Down

0 comments on commit 3b6947e

Please sign in to comment.