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 { ArrowUpFromLine } from "lucide-react";
import type { ScriptItem, Visibility } from "../../services/api";
import { scriptIcon } from "../../features/platform/WorkspaceTree";
import {
@@ -37,6 +37,8 @@ export function PublishModal({
onSubmit,
onClose,
}: PublishModalProps) {
const PublishTargetIcon = publishTarget ? scriptIcon(publishTarget) : null;
return (
<AppFormDialog
open={publishTarget !== null}
@@ -48,7 +50,7 @@ export function PublishModal({
size="panel"
>
<form className={modalFormClass} onSubmit={onSubmit}>
{publishTarget ? (
{publishTarget && PublishTargetIcon ? (
<div className="mb-[17px] flex items-center gap-2.5 rounded-[7px] border border-[#dce6ef] bg-[#f8fbfd] px-3 py-[11px]">
<span
className={`grid size-[25px] shrink-0 place-items-center rounded-[5px] ${
@@ -57,7 +59,7 @@ export function PublishModal({
: "bg-[#eaf3ff] text-[#2e73c6]"
}`}
>
<Icon name={scriptIcon(publishTarget)} size={18} />
<PublishTargetIcon size={18} />
</span>
<span className="flex min-w-0 flex-col gap-0.5">
<strong className="truncate text-xs text-[#34485d]">
@@ -114,7 +116,7 @@ export function PublishModal({
>
{publishing
? <span className="button-spinner" />
: <Icon name="release" size={16} />}
: <ArrowUpFromLine size={16} />}
{publishing ? "正在发布…" : "确认发布"}
</Button>
</div>