@pagerduty/backstage-plugin
Version:
A Backstage plugin that integrates towards PagerDuty
43 lines (40 loc) • 1.43 kB
JavaScript
import React from 'react';
import { makeStyles, IconButton } from '@material-ui/core';
import OpenInBrowserIcon from '@material-ui/icons/OpenInBrowser';
function OpenServiceButton({ serviceUrl, compact }) {
const useStyles = makeStyles((theme) => ({
buttonStyle: {
color: theme.palette.text.primary,
"&:hover": {
backgroundColor: "transparent",
textDecoration: "underline"
}
},
containerStyle: {
fontSize: compact !== true ? "12px" : "10px",
width: compact !== true ? "85px" : "70px"
},
iconStyle: {
fontSize: "30px",
marginBottom: "-10px"
},
textStyle: {
marginBottom: "-10px"
}
}));
const { buttonStyle, containerStyle, iconStyle, textStyle } = useStyles();
function navigateToService() {
window.open(serviceUrl, "_blank");
}
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
IconButton,
{
"aria-label": "open-service-in-browser",
onClick: navigateToService,
className: buttonStyle
},
/* @__PURE__ */ React.createElement("div", { className: containerStyle }, /* @__PURE__ */ React.createElement(OpenInBrowserIcon, { className: iconStyle }), /* @__PURE__ */ React.createElement("p", { className: textStyle }, "Open service in PagerDuty"))
));
}
export { OpenServiceButton };
//# sourceMappingURL=OpenServiceButton.esm.js.map