diff --git a/packages/app/src/components/catalog/EntityPage.tsx b/packages/app/src/components/catalog/EntityPage.tsx
index 931979d2d6..79ca074c35 100644
--- a/packages/app/src/components/catalog/EntityPage.tsx
+++ b/packages/app/src/components/catalog/EntityPage.tsx
@@ -31,7 +31,7 @@ import { Router as ApiDocsRouter } from '@backstage/plugin-api-docs';
import { Router as SentryRouter } from '@backstage/plugin-sentry';
import { EmbeddedDocsRouter as DocsRouter } from '@backstage/plugin-techdocs';
import { Router as KubernetesRouter } from '@backstage/plugin-kubernetes';
-import React from 'react';
+import React, { ReactNode } from 'react';
import {
AboutCard,
EntityPageLayout,
@@ -61,21 +61,34 @@ const CICDSwitcher = ({ entity }: { entity: Entity }) => {
}
};
+const RecentCICDRunsSwitcher = ({ entity }: { entity: Entity }) => {
+ let content: ReactNode;
+ switch (true) {
+ case isJenkinsAvailable(entity):
+ content = ;
+ break;
+ case isGitHubActionsAvailable(entity):
+ content = ;
+ break;
+ default:
+ content = null;
+ }
+ if (!content) {
+ return null;
+ }
+ return (
+
+ {content}
+
+ );
+};
+
const OverviewContent = ({ entity }: { entity: Entity }) => (
- {isJenkinsAvailable(entity) && (
-
-
-
- )}
- {isGitHubActionsAvailable(entity) && (
-
-
-
- )}
+
);