fix: 删除前端冗余按钮组件

This commit is contained in:
2026-04-17 14:56:58 +08:00
parent 61e9b87e98
commit 66081048f9
+4 -39
View File
@@ -1,19 +1,10 @@
import { useGraphStore } from '../../store/graphStore';
import { useGraphStore } from "../../store/graphStore";
export function Toolbar() {
const {
startCreatingNode,
loading,
refresh,
setLayoutType,
layoutType,
} = useGraphStore();
const { startCreatingNode, loading, refresh, setLayoutType, layoutType } =
useGraphStore();
const layouts = [
{ type: 'force' as const, label: '力导向', icon: '🕸️' },
{ type: 'circular' as const, label: '圆形', icon: '⭕' },
{ type: 'grid' as const, label: '网格', icon: '▦' },
];
const layouts = [{ type: "force" as const, label: "力导向", icon: "🕸️" }];
return (
<div className="bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-4 py-2 flex items-center gap-2">
@@ -38,32 +29,6 @@ export function Toolbar() {
<span>🔄</span>
<span>刷新</span>
</button>
<div className="ml-2 flex items-center gap-1">
{layouts.map((layout) => (
<button
key={layout.type}
type="button"
onClick={() => setLayoutType(layout.type)}
className={`flex items-center gap-1.5 px-3 py-1.5 text-sm rounded transition-colors ${
layoutType === layout.type
? 'bg-blue-500 text-white'
: 'bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600'
}`}
>
<span>{layout.icon}</span>
<span>{layout.label}</span>
</button>
))}
</div>
<div className="w-px h-6 bg-gray-300 dark:bg-gray-600 ml-2" />
<div className="text-xs text-gray-500 dark:text-gray-400 flex gap-3">
<span>Ctrl+N 创建节点</span>
<span>Ctrl+E 编辑节点</span>
<span>Delete 删除</span>
</div>
</div>
);
}