import React from 'react'; import { Link } from 'react-router-dom'; import { EmptyStateBody, EmptyStateActions } from '@patternfly/react-core'; import emptyStateImgUrl from '../../assets/Commit.svg'; import { ComponentModel } from '../../models'; import { IMPORT_PATH } from '../../routes/paths'; import AppEmptyState from '../../shared/components/empty-state/AppEmptyState'; import { useNamespace } from '../../shared/providers/Namespace'; import { useAccessReviewForModel } from '../../utils/rbac'; import { ButtonWithAccessTooltip } from '../ButtonWithAccessTooltip'; type CommitsEmptyStateProps = { applicationName: string; }; /** * @deprecated * Replaced by CommitsEmptyStateV2 with new component model */ export const CommitsEmptyState: React.FC> = ({ applicationName, }) => { const namespace = useNamespace(); const [canCreateComponent] = useAccessReviewForModel(ComponentModel, 'create'); return ( Monitor any activity that happens once you push a commit. We’ll build and test your source code, for both pull requests and merged code.
To get started, add a component and merge its pull request for a build pipeline.
( )} variant="secondary" isDisabled={!canCreateComponent} tooltip="You don't have access to add a component" analytics={{ link_name: 'add-component', link_location: 'commits-empty-state', app_name: applicationName, }} > Add component
); }; export default CommitsEmptyState;