import type { AIWorkflowNodeSpec } from "@/lib/api/admin"
export function WorkflowSimpleNodeContent({
spec,
}: {
spec?: AIWorkflowNodeSpec
}) {
const inputCount = spec?.inputSchema?.length ?? 0
const outputCount = spec?.outputSchema?.length ?? 0
const hasSchema = inputCount > 0 || outputCount > 0
if (!hasSchema && !spec?.riskLevel && !spec?.interruptible) {
return (
通过右侧面板配置节点参数
)
}
return (
{inputCount > 0 ? : null}
{outputCount > 0 ? : null}
{spec?.riskLevel ? : null}
{spec?.interruptible ? : null}
)
}
function NodeInfoChip({ label }: { label: string }) {
return (
{label}
)
}
function riskLevelLabel(riskLevel: AIWorkflowNodeSpec["riskLevel"]) {
if (riskLevel === "high") return "高风险"
if (riskLevel === "medium") return "中风险"
return "低风险"
}