updata:icon替换

This commit is contained in:
xiaozhu
2026-09-02 10:10:41 +08:00
committed by tao.chen
parent 3a5cc12782
commit af2f035d03
17 changed files with 159 additions and 304 deletions
@@ -1,4 +1,14 @@
import Icon from "../../components/common/Icon";
import {
BookOpen,
Database,
FileCode,
FileText,
Folder,
Lock,
Unlock,
Upload,
X,
} from "lucide-react";
import type { ScriptItem, ScriptType } from "../../services/api";
type ContextMenuState = {
@@ -45,6 +55,7 @@ export function TreeContextMenu({
if (!contextMenu) return null;
const isDataResource = !!contextMenu.script?.script_id.startsWith("data:");
const LockToggleIcon = contextMenu.script?.is_locked ? Unlock : Lock;
return (
<div
@@ -71,7 +82,7 @@ export function TreeContextMenu({
onClose();
}}
>
<Icon name="database" size={16} />
<Database size={16} />
Jupyter
</button>
{onRemoveResource && (
@@ -85,7 +96,7 @@ export function TreeContextMenu({
onClose();
}}
>
<Icon name="close" size={16} />
<X size={16} />
</button>
)}
@@ -101,7 +112,7 @@ export function TreeContextMenu({
onClose();
}}
>
<Icon name="script" size={16} />
<FileText size={16} />
</button>
<button
@@ -113,10 +124,7 @@ export function TreeContextMenu({
onClose();
}}
>
<Icon
name={contextMenu.script.is_locked ? "unlock" : "lock"}
size={16}
/>
<LockToggleIcon size={16} />
{contextMenu.script.is_locked ? "解锁文件" : "锁定文件"}
</button>
<button
@@ -125,7 +133,7 @@ export function TreeContextMenu({
role="menuitem"
onClick={() => onRemoveScript(contextMenu.script!)}
>
<Icon name="close" size={16} />
<X size={16} />
</button>
</>
@@ -139,7 +147,7 @@ export function TreeContextMenu({
className={menuItemClass}
onClick={() => onOpenCreateDialog(contextMenu.path, "notebook")}
>
<Icon name="notebook" size={16} />
<BookOpen size={16} />
Notebook
</button>
<button
@@ -148,7 +156,7 @@ export function TreeContextMenu({
className={menuItemClass}
onClick={() => onOpenCreateDialog(contextMenu.path, "python")}
>
<Icon name="python" size={16} />
<FileCode size={16} />
Python
</button>
<button
@@ -157,7 +165,7 @@ export function TreeContextMenu({
className={menuItemClass}
onClick={() => onOpenFolderDialog(contextMenu.path)}
>
<Icon name="folder" size={16} />
<Folder size={16} />
</button>
<button
@@ -166,7 +174,7 @@ export function TreeContextMenu({
className={menuItemClass}
onClick={() => onChooseUpload(contextMenu.path)}
>
<Icon name="upload" size={16} />
<Upload size={16} />
</button>
{contextMenu.kind === "directory" && (
@@ -178,7 +186,7 @@ export function TreeContextMenu({
role="menuitem"
onClick={() => onRemoveDirectory(contextMenu.path)}
>
<Icon name="close" size={16} />
<X size={16} />
</button>
</>