diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index fbba6ab686..23771d3ec9 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -44,7 +44,7 @@ export function AboutCard({ variant }: AboutCardProps): JSX.Element; // Warning: (ae-missing-release-tag) "AboutContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const AboutContent: ({ entity }: Props_2) => JSX.Element; +export const AboutContent: ({ entity }: Props) => JSX.Element; // Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "AboutField" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) @@ -55,7 +55,7 @@ export const AboutField: ({ value, gridSizes, children, -}: Props_3) => JSX.Element; +}: Props_2) => JSX.Element; // @public (undocumented) export type BackstageOverrides = Overrides & { @@ -444,11 +444,19 @@ export type PluginCatalogComponentsNameToClassKey = { PluginCatalogSystemDiagramCard: SystemDiagramCardClassKey; }; -// Warning: (ae-forgotten-export) The symbol "RelatedEntitiesCard" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "RelatedEntitiesCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // // @public (undocumented) -export const RelatedEntitiesCard: RelatedEntitiesCard_2; +export const RelatedEntitiesCard: (props: { + variant?: 'gridItem' | undefined; + title: string; + columns: TableColumn[]; + entityKind?: string | undefined; + relationType: string; + emptyMessage: string; + emptyHelpLink: string; + asRenderableEntities: (entities: Entity[]) => T[]; +}) => JSX.Element; // Warning: (ae-missing-release-tag) "Router" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx b/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx index 873a22adfc..ec6ea696e2 100644 --- a/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx +++ b/plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx @@ -41,16 +41,30 @@ type Props = { asRenderableEntities: (entities: Entity[]) => T[]; }; -export function RelatedEntitiesCard({ - variant = 'gridItem', - title, - columns, - entityKind, - relationType, - emptyMessage, - emptyHelpLink, - asRenderableEntities, -}: Props) { +/** + * A low level card component that can be used as a building block for more + * specific cards. + * + * @remarks + * + * You probably want to make a dedicated component for your needs, which renders + * this card as its implementation with some of the props set to the appropriate + * values. + * + * @public + */ +export const RelatedEntitiesCard = (props: Props) => { + const { + variant = 'gridItem', + title, + columns, + entityKind, + relationType, + emptyMessage, + emptyHelpLink, + asRenderableEntities, + } = props; + const { entity } = useEntity(); const { entities, loading, error } = useRelatedEntities(entity, { type: relationType, @@ -89,4 +103,4 @@ export function RelatedEntitiesCard({ entities={asRenderableEntities(entities || [])} /> ); -} +};