import React from "react"; import { FiDownload, FiZoomIn, FiZoomOut, FiMove, FiLink, } from "react-icons/fi"; import { useGraphStore } from "../store/useGraphStore"; import type { GraphData } from "../types"; interface GraphControlsProps { fgRef: React.RefObject; onExport?: () => void; onDataChange?: (data: GraphData) => void; } const btnStyle: React.CSSProperties = { backgroundColor: "var(--bg-secondary)", color: "var(--text-primary)", }; export const GraphControls: React.FC = ({ fgRef, onExport, onDataChange, }) => { const isLinkMode = useGraphStore((s) => s.isLinkMode); const toggleLinkMode = useGraphStore((s) => s.toggleLinkMode); const exportData = useGraphStore((s) => s.exportData); const handleZoomIn = () => { if (fgRef.current) { const currentZoom = fgRef.current.zoom(); fgRef.current.zoom(currentZoom * 1.2); } }; const handleZoomOut = () => { if (fgRef.current) { const currentZoom = fgRef.current.zoom(); fgRef.current.zoom(currentZoom / 1.2); } }; const handleFit = () => { if (fgRef.current) { fgRef.current.zoomToFit(400); } }; return (
{/* Режим создания связи */} {/* */} {/* Зум + */} {/* Зум - */} {/* Fit */} {/* Экспорт */}
); };