update: replace Icon with lucide-react
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import { memo, useMemo, useState } from "react";
|
||||
|
||||
import { type ScheduleArtifact } from "../../services/api";
|
||||
import Icon from "../../components/common/Icon";
|
||||
import { type ScheduleArtifact } from "~/services/api";
|
||||
import {
|
||||
BookText,
|
||||
ChevronRight,
|
||||
ExternalLink,
|
||||
FileCode2,
|
||||
GripVertical,
|
||||
Search,
|
||||
} from "lucide-react";
|
||||
import { shortHash } from "./utils";
|
||||
|
||||
// 包裹 memo 让父级 SchedulePage 在画布交互(setSelectedNodeId /
|
||||
@@ -68,7 +75,7 @@ function ArtifactListImpl({
|
||||
</div>
|
||||
</div>
|
||||
<label className="mx-[10px] mb-[7px] flex min-h-[35px] items-center gap-[7px] rounded-[6px] border border-[#dce5ed] bg-white px-[9px] text-[#95a3b2] focus-within:border-[#8db9e8] focus-within:shadow-[0_0_0_3px_rgb(38_124_216_/_8%)]">
|
||||
<Icon name="search" size={15} />
|
||||
<Search size={15} />
|
||||
<input
|
||||
className="min-w-0 flex-1 border-0 bg-transparent text-[12px] text-[#33475d] outline-none placeholder:text-[#a6b2be]"
|
||||
value={keyword}
|
||||
@@ -85,7 +92,6 @@ function ArtifactListImpl({
|
||||
groups.map(([scriptName, items]) => {
|
||||
const isExpanded = expandedScriptNames.has(scriptName);
|
||||
const scriptType = items[0].script_type;
|
||||
const iconName = scriptType === "notebook" ? "notebook" : "python";
|
||||
return (
|
||||
<div
|
||||
key={scriptName}
|
||||
@@ -102,7 +108,7 @@ function ArtifactListImpl({
|
||||
data-state={isExpanded ? "open" : "closed"}
|
||||
className="h-[14px] w-[14px] flex-none text-[#9aa7b5] transition-transform duration-[180ms] data-[state=open]:rotate-90"
|
||||
>
|
||||
<Icon name="chevron" size={14} />
|
||||
<ChevronRight size={14} />
|
||||
</span>
|
||||
<span
|
||||
className={`grid h-[27px] w-[27px] flex-none place-items-center rounded-[6px] ${
|
||||
@@ -111,7 +117,11 @@ function ArtifactListImpl({
|
||||
: "bg-[#eaf3ff] text-[#326fc1]"
|
||||
}`}
|
||||
>
|
||||
<Icon name={iconName} size={14} />
|
||||
{scriptType === "notebook" ? (
|
||||
<BookText size={14} />
|
||||
) : (
|
||||
<FileCode2 size={14} />
|
||||
)}
|
||||
</span>
|
||||
<span
|
||||
className="max-w-[125px] min-w-0 truncate text-[11px] font-semibold text-[#33465a] min-[1281px]:max-w-none"
|
||||
@@ -146,7 +156,7 @@ function ArtifactListImpl({
|
||||
>
|
||||
<span className="flex min-w-0 items-center gap-[5px]">
|
||||
<span className="h-[13px] w-[13px] flex-none text-[#c4cdd6] group-hover:text-[#7e8d9d]">
|
||||
<Icon name="grip-vertical" size={13} />
|
||||
<GripVertical size={13} />
|
||||
</span>
|
||||
<span className="flex-none text-[10px] font-semibold text-[#526477]">
|
||||
{artifact.version_label}
|
||||
@@ -156,7 +166,7 @@ function ArtifactListImpl({
|
||||
</span>
|
||||
</span>
|
||||
<span className="grid h-[18px] w-[18px] flex-none place-items-center rounded-[4px] text-[#c1cad3] group-hover:bg-[#eef6ff] group-hover:text-[#287ac5]">
|
||||
<Icon name="external" size={12} />
|
||||
<ExternalLink size={12} />
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
@@ -170,7 +180,7 @@ function ArtifactListImpl({
|
||||
<p className="mx-[10px] mb-[9px] mt-[3px] flex items-center justify-center gap-1 rounded-[6px] border border-line-soft bg-[#f8fafc] p-[7px_8px] text-center text-[9px] leading-[1.45] text-[#8795a4]">
|
||||
<span>按住</span>
|
||||
<span className="inline-flex items-center justify-center text-[#9eabb8]">
|
||||
<Icon name="grip-vertical" size={12} />
|
||||
<GripVertical size={12} />
|
||||
</span>
|
||||
<span>拖拽卡片到画布即可绑定节点</span>
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user