feat(home): add entity presentation api to home page widgets

Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
This commit is contained in:
Benjamin Janssens
2025-05-07 15:25:18 +02:00
parent e6d91b40e9
commit f7ca0fee7a
2 changed files with 18 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-home': patch
---
Added the Catalog presentation API to the HomePageRecentlyVisited and HomePageTopVisited components
@@ -18,16 +18,28 @@ import Typography from '@material-ui/core/Typography';
import { makeStyles } from '@material-ui/core/styles';
import { Visit } from '../../api/VisitsApi';
import { Link } from '@backstage/core-components';
import { EntityRefLink } from '@backstage/plugin-catalog-react';
const useStyles = makeStyles(_theme => ({
const useStyles = makeStyles(theme => ({
name: {
marginLeft: '0.8rem',
marginRight: '0.8rem',
fontSize: theme.typography.body1.fontSize,
},
}));
export const ItemName = ({ visit }: { visit: Visit }) => {
const classes = useStyles();
if (visit.entityRef)
return (
<EntityRefLink
entityRef={visit.entityRef}
className={classes.name}
hideIcon
disableTooltip
/>
);
return (
<Typography
component={Link}