UNPKG

@pagerduty/backstage-plugin

Version:

A Backstage plugin that integrates towards PagerDuty

49 lines (46 loc) 1.46 kB
import { jsx, Fragment, jsxs } from 'react/jsx-runtime'; import { makeStyles, IconButton, Typography } 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__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx( IconButton, { "aria-label": "open-service-in-browser", onClick: navigateToService, className: buttonStyle, children: /* @__PURE__ */ jsxs("div", { className: containerStyle, children: [ /* @__PURE__ */ jsx(OpenInBrowserIcon, { className: iconStyle }), /* @__PURE__ */ jsx(Typography, { className: textStyle, children: "Open service in PagerDuty" }) ] }) } ) }); } export { OpenServiceButton }; //# sourceMappingURL=OpenServiceButton.esm.js.map