@pagerduty/backstage-plugin
Version:
A Backstage plugin that integrates towards PagerDuty
44 lines (41 loc) • 1.27 kB
JavaScript
import { jsxs, jsx } from 'react/jsx-runtime';
import { makeStyles, Typography } from '@material-ui/core';
import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';
import { ButtonIcon } from '@backstage/ui';
function OpenServiceButton({
serviceUrl,
compact
}) {
const useStyles = makeStyles(() => ({
containerStyle: {
fontSize: compact !== true ? "12px" : "10px",
width: compact !== true ? "85px" : "70px",
display: "flex",
flexDirection: "column",
alignItems: "center",
textAlign: "center"
},
textStyle: {
fontSize: "12px"
}
}));
const { containerStyle, textStyle } = useStyles();
function navigateToService() {
window.open(serviceUrl, "_blank");
}
return /* @__PURE__ */ jsxs("div", { className: containerStyle, children: [
/* @__PURE__ */ jsx(
ButtonIcon,
{
"aria-label": "open-service-in-browser",
size: "medium",
onClick: navigateToService,
variant: "tertiary",
icon: /* @__PURE__ */ jsx(OpenInBrowserIcon, {})
}
),
/* @__PURE__ */ jsx(Typography, { className: textStyle, children: "Open service in PagerDuty" })
] });
}
export { OpenServiceButton };
//# sourceMappingURL=OpenServiceButton.esm.js.map