UNPKG

@jbrowse/plugin-linear-genome-view

Version:

JBrowse 2 linear genome view

28 lines (27 loc) 1.92 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const ErrorMessageStackTraceDialog_1 = __importDefault(require("@jbrowse/core/ui/ErrorMessageStackTraceDialog")); const util_1 = require("@jbrowse/core/util"); const Refresh_1 = __importDefault(require("@mui/icons-material/Refresh")); const Report_1 = __importDefault(require("@mui/icons-material/Report")); const material_1 = require("@mui/material"); const mobx_react_1 = require("mobx-react"); const BlockMsg_1 = __importDefault(require("./BlockMsg")); const BlockErrorMessage = (0, mobx_react_1.observer)(function ({ model, }) { return ((0, jsx_runtime_1.jsx)(BlockMsg_1.default, { message: `${model.error}`, severity: "error", action: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: "Reload track", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { "data-testid": "reload_button", onClick: () => { model.reload(); }, children: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}) }) }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: "Show stack trace", children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => { (0, util_1.getSession)(model).queueDialog(onClose => [ ErrorMessageStackTraceDialog_1.default, { onClose, error: model.error, }, ]); }, children: (0, jsx_runtime_1.jsx)(Report_1.default, {}) }) })] }) })); }); exports.default = BlockErrorMessage;