UNPKG

@jbrowse/core

Version:

JBrowse 2 core libraries used by plugins

28 lines (27 loc) 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = FieldName; const jsx_runtime_1 = require("react/jsx-runtime"); const material_1 = require("@mui/material"); const mui_1 = require("tss-react/mui"); const useStyles = (0, mui_1.makeStyles)()(theme => ({ fieldDescription: { '&:hover': { background: theme.palette.mode === 'dark' ? '#e65100' : 'yellow', }, }, fieldName: { wordBreak: 'break-all', minWidth: 90, borderBottom: '1px solid #0003', fontSize: 12, background: theme.palette.action.disabledBackground, marginRight: theme.spacing(1), padding: theme.spacing(0.5), }, })); function FieldName({ description, name, width, prefix = [], }) { const { classes, cx } = useStyles(); const val = [...prefix, name].join('.'); return description ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: description, placement: "left", children: (0, jsx_runtime_1.jsx)("div", { className: cx(classes.fieldDescription, classes.fieldName), children: val }) })) : ((0, jsx_runtime_1.jsx)("div", { className: classes.fieldName, style: { width: width }, children: val })); }