UNPKG

@roadiehq/backstage-plugin-bitbucket-pullrequest

Version:

21 lines (18 loc) 965 B
import { jsx } from 'react/jsx-runtime'; import { Routes, Route } from 'react-router'; import PullRequestList from './PullRequestList.esm.js'; import { BITBUCKET_PULL_REQUESTS_ANNOTATION } from '../utils/isBITBUCKETSlugSet.esm.js'; import { MissingAnnotationEmptyState } from '@backstage/core-components'; import { useEntity } from '@backstage/plugin-catalog-react'; const isBITBUCKETPullRequestsAvailable = (entity) => Boolean(entity.metadata.annotations?.[BITBUCKET_PULL_REQUESTS_ANNOTATION]); const Router = () => { const { entity } = useEntity(); return !isBITBUCKETPullRequestsAvailable(entity) ? /* @__PURE__ */ jsx( MissingAnnotationEmptyState, { annotation: BITBUCKET_PULL_REQUESTS_ANNOTATION } ) : /* @__PURE__ */ jsx(Routes, { children: /* @__PURE__ */ jsx(Route, { path: "/", element: /* @__PURE__ */ jsx(PullRequestList, {}) }) }); }; export { Router, isBITBUCKETPullRequestsAvailable }; //# sourceMappingURL=Router.esm.js.map