"use client"; import { ArrowRight, Database, Sparkles } from "lucide-react"; import { Badge } from "@/components/ui/Badge"; import type { ToolDescriptorView } from "@/lib/api/types"; import { isLegacyTool } from "@/lib/toolbox/toolbox"; import { cardClass } from "@/lib/ui/variants"; interface ToolCardProps { tool: ToolDescriptorView; // 点击:legacy 工具导航到现有页面;新工具开 GeneratorRunner。 onOpen: (tool: ToolDescriptorView) => void; } // 工具箱卡片(对齐 ProjectCard 纸感视觉):标题 + 副标题 + 题材徽标 + NEW/可入库标。 // 纯展示;点击交由 ToolboxPage 分派(legacy 跳转 / 新工具开 runner)。 export function ToolCard({ tool, onOpen }: ToolCardProps) { const legacy = isLegacyTool(tool); // legacy 工具跳现有页面;新工具进结构化预览流,提示语据此分支(不暴露内部 key)。 const hint = legacy ? "前往现有页面" : `${tool.input_fields?.[0]?.label ?? "需求"} → 结构化预览`; return ( ); }