feat: enhance workflow node components with new condition handling and UI improvements

This commit is contained in:
mlogclub
2026-06-28 11:52:32 +08:00
parent 5160499fbf
commit f809b5e526
8 changed files with 432 additions and 169 deletions
@@ -0,0 +1,35 @@
import { cn } from "@/lib/utils"
import {
getWorkflowNodeIconClass,
getWorkflowNodeMeta,
type WorkflowNodeTone,
} from "./workflow-node-meta"
export function WorkflowNodeIcon({
type,
tone,
size = "md",
className,
}: {
type: string
tone?: WorkflowNodeTone
size?: "sm" | "md"
className?: string
}) {
const meta = getWorkflowNodeMeta(type)
const Icon = meta.icon
const resolvedTone = tone ?? meta.tone
return (
<span
className={cn(
"flex shrink-0 items-center justify-center rounded-lg shadow-sm",
size === "md" ? "size-7" : "size-6",
getWorkflowNodeIconClass(resolvedTone),
className
)}
>
<Icon className={size === "md" ? "size-4" : "size-3.5"} />
</span>
)
}