import React from 'react'; import { useParams } from 'react-router-dom'; import { Bullseye, Spinner } from '@patternfly/react-core'; import { DetailsSection } from '~/components/DetailsPage'; import { DependencyRunsListView } from '~/components/MintMaker/DependencyRuns/DependencyRunsListView'; import { DisabledFeatureFlagAlert } from '~/feature-flags/DisabledFeatureFlagAlert'; import { useIsOnFeatureFlag } from '~/feature-flags/hooks'; import { useComponent } from '~/hooks/useComponents'; import { RouterParams } from '~/routes/utils'; import { useNamespace } from '~/shared/providers/Namespace'; import { getErrorState } from '~/shared/utils/error-utils'; export const ComponentDependencyTab: React.FC = () => { const namespace = useNamespace(); const { applicationName, componentName } = useParams(); const [component, loaded, error] = useComponent(namespace, componentName, true); const isKubeArchivePlrEnabled = useIsOnFeatureFlag('pipelineruns-kubearchive'); if (!isKubeArchivePlrEnabled) { return ( ); } if (!loaded) { return ( ); } if (error) { return getErrorState(error, loaded, 'dependency runs'); } return ( ); }; export default ComponentDependencyTab;