interface SourceBadgeProps { source: string confidence: number } const SOURCE_CONFIG: Record = { direct: { color: '#10b981', bg: 'rgba(16,185,129,0.12)', label: 'Direct Match', icon: '⚡' }, chained: { color: '#7c3aed', bg: 'rgba(124,58,237,0.12)', label: 'Fact Chained', icon: '🔗' }, corrected: { color: '#f59e0b', bg: 'rgba(245,158,11,0.12)', label: 'Corrected', icon: '✏️' }, curiosity: { color: '#06b6d4', bg: 'rgba(6,182,212,0.12)', label: 'Curiosity', icon: '🤔' }, fallback: { color: '#ef4444', bg: 'rgba(239,68,68,0.12)', label: 'No Match', icon: '❓' }, } export function SourceBadge({ source, confidence }: SourceBadgeProps) { const cfg = SOURCE_CONFIG[source] || SOURCE_CONFIG.fallback const pct = Math.round(confidence * 100) return (
{cfg.icon} {cfg.label}
{pct}%
) }