// ExplanationPanel.jsx — prikaz objašnjenja zašto je kod klasificiran ovako import { Card, Label, Icon } from './primitives' const SEVERITY_CONFIG = { high: { color: '#EF4444', bg: 'rgba(239,68,68,0.08)', border: 'rgba(239,68,68,0.25)', icon: 'xCircle', label: 'Strong signal', }, medium: { color: '#F59E0B', bg: 'rgba(245,158,11,0.08)', border: 'rgba(245,158,11,0.25)', icon: 'alert', label: 'Moderate signal', }, low: { color: '#94A3B8', bg: 'rgba(148,163,184,0.06)', border: 'rgba(148,163,184,0.15)', icon: 'filter', label: 'Weak signal', }, positive: { color: '#10B981', bg: 'rgba(16,185,129,0.08)', border: 'rgba(16,185,129,0.25)', icon: 'check', label: 'Human indicator', }, } export default function ExplanationPanel({ explanations, verdict, aiProbability }) { if (!explanations || explanations.length === 0) return null const highCount = explanations.filter(e => e.severity === 'high').length const medCount = explanations.filter(e => e.severity === 'medium').length const posCount = explanations.filter(e => e.severity === 'positive').length return ( {/* Header */}

The following signals contributed to the classification. Strong signals carry the most weight; human indicators suggest characteristics inconsistent with AI generation.

{/* Signal summary pills */}
{highCount > 0 && ( {highCount} strong )} {medCount > 0 && ( {medCount} moderate )} {posCount > 0 && ( {posCount} human )}
{/* Explanation items */}
{explanations.map((exp, i) => { const cfg = SEVERITY_CONFIG[exp.severity] || SEVERITY_CONFIG.low return (
{/* Icon */}
{/* Text */}
{cfg.label} {exp.feature.replace(/_/g, ' ')}

{exp.text}

) })}
{/* Footer disclaimer */}
CodeSentinel reports statistical signals, not academic-integrity verdicts. A high AI probability score should be treated as a starting point for review, not as conclusive evidence. Confirm findings with the student before taking any action.
) }