diff --git a/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx b/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx index 59de0a4587..da465a7893 100644 --- a/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx +++ b/plugins/catalog/src/components/EntityLinksCard/EntityLinksCard.tsx @@ -15,7 +15,6 @@ */ import { Entity } from '@backstage/catalog-model'; -import { IconComponent, IconKey, InfoCard, useApp } from '@backstage/core'; import { useEntity } from '@backstage/plugin-catalog-react'; import LanguageIcon from '@material-ui/icons/Language'; import React from 'react'; @@ -23,6 +22,9 @@ import { EntityLinksEmptyState } from './EntityLinksEmptyState'; import { LinksGridList } from './LinksGridList'; import { ColumnBreakpoints } from './types'; +import { IconComponent, useApp } from '@backstage/core-plugin-api'; +import { InfoCard } from '@backstage/core-components'; + type Props = { /** @deprecated The entity is now grabbed from context instead */ entity?: Entity; @@ -34,7 +36,7 @@ export const EntityLinksCard = ({ cols = undefined, variant }: Props) => { const { entity } = useEntity(); const app = useApp(); - const iconResolver = (key: IconKey | undefined): IconComponent => + const iconResolver = (key?: string): IconComponent => key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon; const links = entity?.metadata?.links; diff --git a/plugins/scaffolder/src/components/TaskPage/TaskPageLinks.tsx b/plugins/scaffolder/src/components/TaskPage/TaskPageLinks.tsx index 394d755424..739ddac0fd 100644 --- a/plugins/scaffolder/src/components/TaskPage/TaskPageLinks.tsx +++ b/plugins/scaffolder/src/components/TaskPage/TaskPageLinks.tsx @@ -15,13 +15,13 @@ */ import { parseEntityName } from '@backstage/catalog-model'; -import { IconComponent, IconKey, useApp, useRouteRef } from '@backstage/core'; import { entityRouteRef } from '@backstage/plugin-catalog-react'; import { Box } from '@material-ui/core'; import LanguageIcon from '@material-ui/icons/Language'; import React from 'react'; import { TaskOutput } from '../../types'; import { IconLink } from './IconLink'; +import { IconComponent, useApp, useRouteRef } from '@backstage/core-plugin-api'; type TaskPageLinksProps = { output: TaskOutput; @@ -33,7 +33,7 @@ export const TaskPageLinks = ({ output }: TaskPageLinksProps) => { const app = useApp(); const entityRoute = useRouteRef(entityRouteRef); - const iconResolver = (key: IconKey | undefined): IconComponent => + const iconResolver = (key?: string): IconComponent => key ? app.getSystemIcon(key) ?? LanguageIcon : LanguageIcon; if (remoteUrl) {