import React from 'react' ; import { Grid } from '@material-ui/core' ; import { Page , Content , ContentHeader , SupportButton , MissingAnnotationEmptyState } from '@backstage/core-components' ; import { GITHUB_REPO_ANNOTATION } from '../useProjectName' ; import { DependabotAlertsTable } from '../DependabotAlertsTable' ; import { useEntity } from "@backstage/plugin-catalog-react" ; export const GithubDependabotTab = ( ) => { const { entity } = useEntity ( ) ; const isSecurityInsightsAvailable = ( ) => Boolean ( entity . metadata . annotations ?. [ GITHUB_REPO_ANNOTATION ] ) ; return ! isSecurityInsightsAvailable ( ) ? ( < MissingAnnotationEmptyState annotation = { GITHUB_REPO_ANNOTATION } / > ) : ( < Page themeId = "tool" > < Content > < ContentHeader title = "Dependabot Alerts" > < SupportButton > Plugin to show Dependabot Alerts < /SupportButton> < /ContentHeader> < Grid container spacing = { 3 } direction = "column" > < Grid item > < DependabotAlertsTable /> < /Grid> < /Grid> < /Content> < /Page>); } ;