Newer
Older
import React from "react";
import "./nodeinfobar.css";
import TitleArea from "./titlearea";
import FancyScrollbar from "../fancyscrollbar";
import Neighbors from "./neighbors";
import { NodeType } from "../../../common/graph/nodetype";
import { Node } from "../../../common/graph/node";
interface InfoBarProps {
height: number;

Matthias Konitzny
committed
node: Node;
onClose?: () => void;

Matthias Konitzny
committed
nodeClickedCallback?: (node: Node) => void;
/**
* Displays a sidebar showing information on a specific node.
* @param height Height of the sidebar.
* @param node Node which drives the presented information.
* @param nodeColors Mapping of node types to colors.
* @param onClose Optional callback, called when the menu is closed.
* @param nodeClickedCallback Optional callback, called when a neighbor of the current node gets selected.
* @constructor
*/
function NodeInfoBar({
height,
node,
nodeClickedCallback,
}: InfoBarProps) {
<div className={"node-info-bar"} style={{ height }}>
<div className={"node-info-bar-close-button"} onClick={onClose}>
<p>✖</p>
</div>
<div className={"node-info-bar-info-area"}>
<TitleArea title={node.name} image={node.banner} />
<MediaArea
description={node.description}
image={node.banner}
video={node.video}
references={node.references}
/>
</FancyScrollbar>
</div>
<Neighbors
neighbors={node.neighbors}
nodeColors={nodeColors}
nodeClickedCallback={nodeClickedCallback}
/>
</div>
);
}
export default NodeInfoBar;