File size: 834 Bytes
1e3df84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
interface Props {
  x: number;
  y: number;
  data: Record<string, unknown>;
}

export default function NodeTooltip({ x, y, data }: Props) {
  const type = (data.type as string) || 'unknown';
  const id = (data.id as string) || '';
  const floor = (data.floor as string) || '';

  return (
    <div
      className="node-tooltip"
      style={{ left: x, top: y }}
    >
      <div className="tooltip-type">{type}</div>
      <div>ID: {id}</div>
      {floor && <div>Floor: {floor}</div>}
      {data.area != null && <div>Area: {(data.area as number).toLocaleString()} px</div>}
      {data.eqRadius != null && <div>Eq. Radius: {String(data.eqRadius)}</div>}
      {data.doorType ? <div>Door Type: {String(data.doorType)}</div> : null}
      {data.isSubnode ? <div>Subnode of: {String(data.parentRoom)}</div> : null}
    </div>
  );
}