diff --git a/plugins/addon-catalog/src/ComponentCard/ComponentCard.tsx b/plugins/addon-catalog/src/ComponentCard/ComponentCard.tsx index 48930b161..20887610e 100644 --- a/plugins/addon-catalog/src/ComponentCard/ComponentCard.tsx +++ b/plugins/addon-catalog/src/ComponentCard/ComponentCard.tsx @@ -8,9 +8,11 @@ import { PackageLink, ComponentContributors, ComponentStats, + getStoryTitle, } from '@component-controls/blocks'; import { useStore, + useStory, useStoryComponent, useStoryPath, } from '@component-controls/store'; @@ -32,14 +34,18 @@ export const ComponentCard: FC = ({ }) => { const href = useStoryPath(id); const store = useStore(); + const story = useStory({ id }); const component = useStoryComponent({ id }); if (!component) { return null; } + const doc = story?.doc ? store.docs[story.doc] : undefined; const pckg = component.package ? store.packages[component.package] : undefined; const { browse } = pckg?.repository || {}; + const title = getStoryTitle(doc, component); + const description = component.info?.description || story?.description; return (
= ({ }} > -
- {component.info?.displayName} -
+
{title}
= ({ )}
- {component.info?.description && ( - {component.info.description} - )} + {description && {description}} {store.stories[id] && (