Skip to content

Commit

Permalink
Add tooltip for slice location
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Jul 26, 2024
1 parent 98a27dd commit 9362f5c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apps/nar-v3/src/components/SliceCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,29 @@ limitations under the License.
import Box from "@mui/material/Box";
import Paper from "@mui/material/Paper";
import Stack from "@mui/material/Stack";
import Tooltip from "@mui/material/Tooltip";

import Connection from "./Connection";
import KeyValueTable from "./KeyValueTable";
import { NavigateNext, NavigatePrevious } from "./Navigation";
import styles from "../styles";

function ControlledTerm(props) {
if (props.term.definition) {
return <Tooltip title={props.term.definition}>{props.term.name}</Tooltip>;
} else {
return props.term.name;
}
}

function SliceCard(props) {
if (props.slices) {
const slice = props.slices[props.index].slice;

if (slice) {
const data = {
"Location (todo: add link outs)": slice.anatomicalLocation
.map((item) => item.name)
.map((item) => <ControlledTerm term={item} />)
.join(", "),
};
return (
Expand Down

0 comments on commit 9362f5c

Please sign in to comment.