@roadiehq/backstage-plugin-github-insights
Version:
42 lines (39 loc) • 2.31 kB
JavaScript
import { jsx, jsxs } from 'react/jsx-runtime';
import { Grid } from '@material-ui/core';
import { Page, Content, ContentHeader, SupportButton, MissingAnnotationEmptyState } from '@backstage/core-components';
import { isGithubInsightsAvailable, GITHUB_INSIGHTS_ANNOTATION } from '../utils/isGithubInsightsAvailable.esm.js';
import ContributorsCard from '../Widgets/ContributorsCard/ContributorsCard.esm.js';
import LanguagesCard from '../Widgets/LanguagesCard/LanguagesCard.esm.js';
import ReadMeCard from '../Widgets/ReadMeCard/ReadMeCard.esm.js';
import 'react';
import '@material-ui/lab';
import '@backstage/core-plugin-api';
import 'react-use/lib/useAsync';
import '@octokit/rest';
import 'git-url-parse';
import '@backstage/integration';
import '../../apis/githubApiRef.esm.js';
import '@backstage/integration-react';
import '@roadiehq/github-auth-utils-react';
import ReleasesCard from '../Widgets/ReleasesCard/ReleasesCard.esm.js';
import ComplianceCard from '../Widgets/ComplianceCard/ComplianceCard.esm.js';
import EnvironmentsCard from '../Widgets/EnvironmentsCard/EnvironmentsCard.esm.js';
import { useEntity } from '@backstage/plugin-catalog-react';
const InsightsPage = () => {
const { entity } = useEntity();
return isGithubInsightsAvailable(entity) ? /* @__PURE__ */ jsx(Page, { themeId: "tool", children: /* @__PURE__ */ jsxs(Content, { children: [
/* @__PURE__ */ jsx(ContentHeader, { title: "GitHub Insights", children: /* @__PURE__ */ jsx(SupportButton, { children: "Plugin to show GitHub Insights" }) }),
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, direction: "row", alignItems: "stretch", children: [
/* @__PURE__ */ jsxs(Grid, { item: true, sm: 12, md: 6, lg: 4, children: [
/* @__PURE__ */ jsx(ContributorsCard, {}),
/* @__PURE__ */ jsx(LanguagesCard, {}),
/* @__PURE__ */ jsx(ReleasesCard, {}),
/* @__PURE__ */ jsx(EnvironmentsCard, {}),
/* @__PURE__ */ jsx(ComplianceCard, {})
] }),
/* @__PURE__ */ jsx(Grid, { item: true, sm: 12, md: 6, lg: 8, children: /* @__PURE__ */ jsx(ReadMeCard, { maxHeight: 450 }) })
] })
] }) }) : /* @__PURE__ */ jsx(MissingAnnotationEmptyState, { annotation: GITHUB_INSIGHTS_ANNOTATION });
};
export { InsightsPage };
//# sourceMappingURL=InsightsPage.esm.js.map