@backstage-community/plugin-sonarqube
Version:
32 lines (29 loc) • 1.38 kB
JavaScript
import { jsxs, jsx } from 'react/jsx-runtime';
import { Content, ContentHeader, SupportButton } from '@backstage/core-components';
import { useEntity, MissingAnnotationEmptyState } from '@backstage/plugin-catalog-react';
import { SonarQubeCard } from '../SonarQubeCard/SonarQubeCard.esm.js';
import { isSonarQubeAvailable, SONARQUBE_PROJECT_KEY_ANNOTATION } from '@backstage-community/plugin-sonarqube-react';
import { useTranslationRef } from '@backstage/frontend-plugin-api';
import { sonarqubeTranslationRef } from '../../translation.esm.js';
const SonarQubeContentPage = (props) => {
const { entity } = useEntity();
const { title, supportTitle, missingAnnotationReadMoreUrl } = props;
const { t } = useTranslationRef(sonarqubeTranslationRef);
return isSonarQubeAvailable(entity) ? /* @__PURE__ */ jsxs(Content, { children: [
/* @__PURE__ */ jsx(ContentHeader, { title: title ?? t("title"), children: supportTitle && /* @__PURE__ */ jsx(SupportButton, { children: supportTitle }) }),
/* @__PURE__ */ jsx(
SonarQubeCard,
{
missingAnnotationReadMoreUrl
}
)
] }) : /* @__PURE__ */ jsx(
MissingAnnotationEmptyState,
{
annotation: SONARQUBE_PROJECT_KEY_ANNOTATION,
readMoreUrl: missingAnnotationReadMoreUrl
}
);
};
export { SonarQubeContentPage };
//# sourceMappingURL=SonarQubeContentPage.esm.js.map