UNPKG

@jbrowse/core

Version:

JBrowse 2 core libraries used by plugins

26 lines (25 loc) 1.49 kB
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { Typography, alpha } from '@mui/material'; import ExternalLink from "./ExternalLink.js"; import { makeStyles } from "../util/tss-react/index.js"; const EMAIL = 'jbrowse2@berkeley.edu'; const useStyles = makeStyles()(theme => ({ pre: { background: alpha(theme.palette.error.main, 0.2), border: `1px solid ${theme.palette.divider}`, overflow: 'auto', margin: 20, maxHeight: 300, }, })); export default function ErrorMessageStackTraceContents({ text, extra, }) { const { classes } = useStyles(); const extraStr = extra ? `supporting data: ${JSON.stringify(extra, null, 2)}` : ''; const displayText = [text, extraStr].filter(Boolean).join('\n'); const issueBody = encodeURIComponent(`I got this error from JBrowse, here is the stack trace:\n\n\`\`\`\n${text}\n\`\`\`\n${extraStr}\n`); const githubLink = `https://github.com/GMOD/jbrowse-components/issues/new?labels=bug&title=JBrowse+issue&body=${issueBody}`; const emailLink = `mailto:${EMAIL}?subject=JBrowse%202%20error&body=${issueBody}`; return (_jsxs(_Fragment, { children: [_jsxs(Typography, { children: ["Post a new issue at", ' ', _jsx(ExternalLink, { href: githubLink, children: "GitHub" }), " or send an email to ", _jsx(ExternalLink, { href: emailLink, children: EMAIL })] }), _jsx("pre", { className: classes.pre, children: displayText })] })); }