File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 1- import { Entity } from "@backstage/catalog-model" ;
1+ import React from 'react' ;
2+ import { Entity } from '@backstage/catalog-model' ;
3+ import { useEntity } from '@backstage/plugin-catalog-react' ;
4+ import { Route } from 'react-router' ;
5+ import { FlatRoutes } from '@backstage/core-app-api' ;
26import { MissingAnnotationEmptyState } from "@backstage/core-components" ;
3- import React from "react" ;
4- import { Route , Routes } from "react-router" ;
57import { HarborDashboardPage } from "./components/HarborDashboardPage" ;
68import { HARBOR_ANNOTATION_REPOSITORY } from "./components/useHarborAppData" ;
79import { isHarborAvailable } from "./plugin" ;
810
9- export const Router = ( { entity } : { entity : Entity } ) => {
11+ type Props = {
12+ /** @deprecated The entity is now grabbed from context instead */
13+ entity ?: Entity ;
14+ } ;
15+ export const Router = ( _props : Props ) => {
16+ const { entity } = useEntity ( ) ;
1017 return ! isHarborAvailable ( entity ) ? (
1118 < MissingAnnotationEmptyState annotation = { HARBOR_ANNOTATION_REPOSITORY } />
1219 ) : (
13- < Routes >
20+ < FlatRoutes >
1421 < Route path = "/" element = { < HarborDashboardPage entity = { entity } /> } />
15- </ Routes >
22+ </ FlatRoutes >
1623 ) ;
1724} ;
You can’t perform that action at this time.
0 commit comments