import { useState, useEffect, useRef, useCallback } from 'react'; import { IconButton, Tooltip, ToggleButton, ToggleButtonGroup } from '@mui/material'; import ChevronLeftIcon from '@mui/icons-material/ChevronLeft'; import ChevronRightIcon from '@mui/icons-material/ChevronRight'; import DeleteIcon from '@mui/icons-material/Delete'; import SwapHorizIcon from '@mui/icons-material/SwapHoriz'; import ArrowForwardIcon from '@mui/icons-material/ArrowForward'; import SyncAltIcon from '@mui/icons-material/SyncAlt'; import RemoveIcon from '@mui/icons-material/Remove'; import { usePanelStore } from '../../stores/panelStore'; import { useGraphWithHistory } from '../../hooks/useGraphWithHistory'; import { useDocumentHistory } from '../../hooks/useDocumentHistory'; import { useConfirm } from '../../hooks/useConfirm'; import GraphMetrics from '../Common/GraphMetrics'; import { getIconComponent } from '../../utils/iconUtils'; import type { Actor, Relation, EdgeDirectionality } from '../../types'; /** * RightPanel - Context-aware properties panel on the right side * * Features: * - Shows properties of selected node(s) or edge(s) * - Live property updates (no save button) * - Connection information for actors * - Multi-selection support * - Non-modal design (doesn't block graph view) * - Collapsible */ interface Props { selectedNode: Actor | null; selectedEdge: Relation | null; onClose: () => void; } /** * PanelHeader - Reusable header component for right panel views */ interface PanelHeaderProps { title: string; onCollapse: () => void; } const PanelHeader = ({ title, onCollapse }: PanelHeaderProps) => (
No connections
) : (Node ID: {selectedNode.id}
Position: ({Math.round(selectedNode.position.x)}, {Math.round(selectedNode.position.y)})
Saving changes...
)}Leave empty to use default type label
Saving changes...
)}