const SOURCE_CONFIG: Record = { internal_kb: { label: "内部知识库", className: "bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400" }, ticket_system: { label: "工单系统", className: "bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400" }, external_web: { label: "外部搜索", className: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400" }, code_execution: { label: "代码执行", className: "bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400" }, generated_doc: { label: "生成文档", className: "bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400" }, inferred: { label: "模型推断", className: "bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400" }, }; const CONFIDENCE_ICON: Record = { high: "●", medium: "○", low: "!" }; interface SourceBadgeProps { sourceType?: string; confidence?: "high" | "medium" | "low"; } export function SourceBadge({ sourceType = "inferred", confidence = "high" }: SourceBadgeProps) { const config = SOURCE_CONFIG[sourceType] ?? SOURCE_CONFIG.inferred; return ( {CONFIDENCE_ICON[confidence]} {config.label} ); }