feat: simplify WorkflowNodeCard and WorkflowNodeIcon by removing tone handling and unused imports
This commit is contained in:
@@ -1,31 +1,23 @@
|
||||
import { cn } from "@/lib/utils"
|
||||
import {
|
||||
getWorkflowNodeIconClass,
|
||||
getWorkflowNodeMeta,
|
||||
type WorkflowNodeTone,
|
||||
} from "./workflow-node-meta"
|
||||
import { getWorkflowNodeMeta } 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",
|
||||
"flex shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground shadow-sm",
|
||||
size === "md" ? "size-7" : "size-6",
|
||||
getWorkflowNodeIconClass(resolvedTone),
|
||||
className
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user