"use client"; type RuleExplanationProps = { explanation?: string; examples?: string[]; missingPatterns?: string[]; edgeCases?: string[]; improvements?: string[]; severity?: string; }; export function RuleExplanation({ explanation, examples = [], missingPatterns = [], edgeCases = [], improvements = [], severity, }: RuleExplanationProps) { if (!explanation && examples.length === 0 && missingPatterns.length === 0) { return null; } const severityColors = { low: "bg-blue-500/20 border-blue-500/50 text-blue-200", medium: "bg-yellow-500/20 border-yellow-500/50 text-yellow-200", high: "bg-orange-500/20 border-orange-500/50 text-orange-200", critical: "bg-red-500/20 border-red-500/50 text-red-200", }; const severityColor = severityColors[severity as keyof typeof severityColors] || severityColors.medium; return (
{explanation}