mirror of
https://github.com/OFFIS-ESC/constellation-analyzer
synced 2026-01-27 15:53:42 +00:00
fix: lint issues unused fns
This commit is contained in:
parent
045b1aa4d6
commit
869e4d5f68
1 changed files with 22 additions and 9 deletions
31
src/App.tsx
31
src/App.tsx
|
|
@ -40,16 +40,19 @@ import type { ExportOptions } from "./utils/graphExport";
|
|||
function AppContent() {
|
||||
const { undo, redo } = useDocumentHistory();
|
||||
const { activeDocumentId } = useWorkspaceStore();
|
||||
const { toggleLeftPanel, toggleRightPanel, leftPanelVisible, rightPanelVisible } = usePanelStore();
|
||||
const { leftPanelVisible, rightPanelVisible } = usePanelStore();
|
||||
const [showDocumentManager, setShowDocumentManager] = useState(false);
|
||||
const [showKeyboardHelp, setShowKeyboardHelp] = useState(false);
|
||||
const [selectedNode, setSelectedNode] = useState<Actor | null>(null);
|
||||
const [selectedEdge, setSelectedEdge] = useState<Relation | null>(null);
|
||||
const [addNodeCallback, setAddNodeCallback] = useState<((nodeTypeId: string, position?: { x: number; y: number }) => void) | null>(null);
|
||||
const [exportCallback, setExportCallback] = useState<((format: 'png' | 'svg', options?: ExportOptions) => Promise<void>) | null>(null);
|
||||
const [addNodeCallback, setAddNodeCallback] = useState<
|
||||
((nodeTypeId: string, position?: { x: number; y: number }) => void) | null
|
||||
>(null);
|
||||
const [exportCallback, setExportCallback] = useState<
|
||||
((format: "png" | "svg", options?: ExportOptions) => Promise<void>) | null
|
||||
>(null);
|
||||
const { fitView } = useReactFlow();
|
||||
|
||||
|
||||
// Listen for document manager open event from EmptyState
|
||||
useEffect(() => {
|
||||
const handleOpenDocumentManager = () => {
|
||||
|
|
@ -87,7 +90,7 @@ function AppContent() {
|
|||
useEffect(() => {
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
// Escape: Close property panels
|
||||
if (e.key === 'Escape') {
|
||||
if (e.key === "Escape") {
|
||||
if (selectedNode || selectedEdge) {
|
||||
e.preventDefault();
|
||||
setSelectedNode(null);
|
||||
|
|
@ -96,8 +99,8 @@ function AppContent() {
|
|||
}
|
||||
};
|
||||
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
return () => window.removeEventListener('keydown', handleKeyDown);
|
||||
window.addEventListener("keydown", handleKeyDown);
|
||||
return () => window.removeEventListener("keydown", handleKeyDown);
|
||||
}, [selectedNode, selectedEdge]);
|
||||
|
||||
return (
|
||||
|
|
@ -167,8 +170,18 @@ function AppContent() {
|
|||
setSelectedNode(null);
|
||||
}
|
||||
}}
|
||||
onAddNodeRequest={(callback: (nodeTypeId: string, position?: { x: number; y: number }) => void) => setAddNodeCallback(() => callback)}
|
||||
onExportRequest={(callback: (format: 'png' | 'svg', options?: ExportOptions) => Promise<void>) => setExportCallback(() => callback)}
|
||||
onAddNodeRequest={(
|
||||
callback: (
|
||||
nodeTypeId: string,
|
||||
position?: { x: number; y: number },
|
||||
) => void,
|
||||
) => setAddNodeCallback(() => callback)}
|
||||
onExportRequest={(
|
||||
callback: (
|
||||
format: "png" | "svg",
|
||||
options?: ExportOptions,
|
||||
) => Promise<void>,
|
||||
) => setExportCallback(() => callback)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue