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,5 +1,5 @@
import { type FormEvent } from "react";
import Icon from "../../components/common/Icon";
import { BookOpen, Check, FileCode, Folder, Plus } from "lucide-react";
import type { ScriptType, Visibility } from "../../services/api";
import {
AppFormDialog,
@@ -57,7 +57,7 @@ export function CreateScriptModal({
>
<form className={modalFormClass} onSubmit={onSubmit}>
<div className={destinationChipClass}>
<Icon name="folder" size={16} />
<Folder size={16} />
{form.parentPath || "个人根目录"}
</div>
<label className={formFieldClass}>
@@ -92,7 +92,7 @@ export function CreateScriptModal({
type: "notebook" as const,
title: "Jupyter Notebook",
desc: "交互式数据探索与模型实验",
icon: "notebook" as const,
Icon: BookOpen,
iconTone: "bg-[#fff0ed] text-[#dd5a4c]",
size: 22,
},
@@ -100,13 +100,14 @@ export function CreateScriptModal({
type: "python" as const,
title: "Python 脚本",
desc: "批处理、训练和模型调用任务",
icon: "python" as const,
Icon: FileCode,
iconTone: "bg-[#e9f3ff] text-[#2a75c5]",
size: 23,
},
] as const
).map((item) => {
const selected = form.scriptType === item.type;
const TypeIcon = item.Icon;
return (
<button
key={item.type}
@@ -124,7 +125,7 @@ export function CreateScriptModal({
<span
className={`grid size-[37px] shrink-0 place-items-center rounded-lg ${item.iconTone}`}
>
<Icon name={item.icon} size={item.size} />
<TypeIcon size={item.size} />
</span>
<span className="flex min-w-0 flex-col">
<strong className="text-[11px] text-[#34475b]">
@@ -136,7 +137,7 @@ export function CreateScriptModal({
</span>
{selected && (
<span className="absolute top-1.5 right-1.5 grid size-[17px] place-items-center rounded-full bg-[#2e88dd] text-white">
<Icon name="check" size={14} />
<Check size={14} />
</span>
)}
</button>
@@ -178,7 +179,7 @@ export function CreateScriptModal({
disabled={creating || !form.name.trim()}
className={dialogPrimaryButtonClass}
>
{creating ? <span className="button-spinner" /> : <Icon name="plus" size={16} />}
{creating ? <span className="button-spinner" /> : <Plus size={16} />}
{creating ? "正在创建…" : "创建脚本"}
</Button>
</div>