@backstage-community/plugin-sonarqube
Version:
58 lines (55 loc) • 1.67 kB
JavaScript
import { jsx, jsxs } from 'react/jsx-runtime';
import { Link } from '@backstage/core-components';
import Grid from '@material-ui/core/Grid';
import Typography from '@material-ui/core/Typography';
import { makeStyles } from '@material-ui/core/styles';
const useStyles = makeStyles((theme) => {
return {
root: {
margin: theme.spacing(1, 0),
minWidth: "140px"
},
upper: {
display: "flex",
justifyContent: "center",
alignItems: "center"
},
cardTitle: {
textAlign: "center"
},
wrapIcon: {
display: "inline-flex",
verticalAlign: "baseline"
},
left: {
display: "flex"
},
right: {
display: "flex",
marginLeft: theme.spacing(0.5)
}
};
});
const RatingCard = ({
leftSlot,
rightSlot,
title,
titleIcon,
link,
compact
}) => {
const classes = useStyles();
return /* @__PURE__ */ jsx(Link, { to: link, color: "inherit", underline: "none", children: /* @__PURE__ */ jsxs(Grid, { item: true, className: compact ? "" : classes.root, children: [
/* @__PURE__ */ jsxs(Grid, { item: true, className: classes.upper, children: [
/* @__PURE__ */ jsx(Grid, { item: true, className: classes.left, children: leftSlot }),
/* @__PURE__ */ jsx(Grid, { item: true, className: classes.right, children: rightSlot })
] }),
compact || /* @__PURE__ */ jsx(Grid, { item: true, className: classes.cardTitle, children: /* @__PURE__ */ jsxs(Typography, { variant: "body1", className: classes.wrapIcon, children: [
titleIcon,
" ",
title
] }) })
] }) });
};
export { RatingCard };
//# sourceMappingURL=RatingCard.esm.js.map